From: Marcin Raczkowski Date: 2007-05-31T18:42:51+09:00 Subject: Re: DRb and Thread safety On Thursday 31 May 2007 02:29, Erwin Abbott wrote: > 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 Rinda::TupleSpace is just an array of arrays with few sophisticated functions that let you find tuples (arrays) with one element matching. if you want thread safety write your own monitors or just use mutexes also you can use already thread safe classes like Queue greets -- Marcin Raczkowski --- Friends teach what you should know Enemies Teach what you have to know