How to write thread safe ruby code?

Hi,

I am using RUBY VERSION: 1.8.6,Rails 2.3.2 and Backgroundrb. I am
running into inconsistent data when using 10 threads per backgroundrb
worker class.
I each thread retrieves orders for each of the store. Some times
i see orders of the one store are copied into another store.
So orders of the one thread are copied into another thread.

Can any one help in this regard?

···

--
Posted via http://www.ruby-forum.com/.

http://en.wikibooks.org/wiki/Ruby_Programming/Reference/Objects/Thread
might help (especially "controlling concurrency")

···

--
Posted via http://www.ruby-forum.com/.