E
Erwin Abbott
I've been reading about DRb and one issue that I still have questions
about is thread safety. Every website I've come across uses very
basic examples where the client never does anything that would modify
the distributed object.
For sake of discussion, let's say I'm writing an application that's
some kind of database. Clients can add, delete, search, or modify
records. How can this be written so clients can't step on each other,
or block the whole database while perfoming and update on a single
record? Having a mutex for every record doesn't seem very elegant.
I'm also still getting aquainted with threads, and I want to be sure I
have this right: each thread has it's own "local" variables, so if two
threads have access to the same array and they both call array.max...
any local vars used in the #max method won't be "stepped on" by the
other thread. As long as #max doesn't change any variables outside its
method scope, it will be thread safe?
Thanks,
Erwin
about is thread safety. Every website I've come across uses very
basic examples where the client never does anything that would modify
the distributed object.
For sake of discussion, let's say I'm writing an application that's
some kind of database. Clients can add, delete, search, or modify
records. How can this be written so clients can't step on each other,
or block the whole database while perfoming and update on a single
record? Having a mutex for every record doesn't seem very elegant.
I'm also still getting aquainted with threads, and I want to be sure I
have this right: each thread has it's own "local" variables, so if two
threads have access to the same array and they both call array.max...
any local vars used in the #max method won't be "stepped on" by the
other thread. As long as #max doesn't change any variables outside its
method scope, it will be thread safe?
Thanks,
Erwin