monitor and update an object collaboratively

Vladimir Sekissov svg@REDACTED
Thu Mar 20 20:08:43 CET 2003


Good day,

I think global locks would be the simplest way:

update_board(BoardName, RowNum, Data) ->
  LockId = {{BoardName, RowNum}, {node(), self()}},
  case global:trans(LockId,
               fun () ->
                 set_board_row(BoardName, RowNum, Data)
               end) of
    aborted ->
      {error, locked};
    Ret ->
      Ret
  end.

Best Regards,
Vladimir Sekissov

hp> Hi, 
hp>   Is there an example of codes for doing the following ?
hp>   
hp>   An object (a file contents, a drawing board etc)
hp>   is monitored by many users on different nodes.
hp>   Each user can modify the object.
hp>   At that time of modification by one user,
hp>   all others can only 'see' but not be able to modify the object.
hp>   
hp> thanks,
hp> HP



More information about the erlang-questions mailing list