From: "dtuttle1@..." Date: 2007-08-25T16:05:04+09:00 Subject: Re: Thread safety techniques for server applications? Hi Aaron, I'd like to learn more in this area too, but here are my thoughts: The web servers, at least mongrel, are single-threaded. Mongrel queues requests and feeds them to the app sequentially. To get concurrency you have to run multiple instances of mongrel. In this situation there are no thread safety issues because there's only one thread per process. I like the idea of separate processes instead of worrying about thread safety, but sometimes I need multiple threads, for example in a jabber client (keepalives, listeners, etc). What I've been doing is keeping it as simple as possible and so far I haven't had to think about thread conflicts. Or maybe I should be but I haven't ;) --Dave On Aug 24, 7:05 pm, Aaron Smith wrote: > Hey all, > > I'm looking for some information about handling thread safety with Ruby. > I've got an application server I wrote that I need to make sure it's > thread safe. This application server is used over http requests so it's > possible multiple people hit it at once. I have some questions that will > help me determine.. > > 1. Does using mongrel / lighttpd / webrick, ensure thread saftey? (my > application relies on these) > 2. What kinds of things in the Ruby language should I NOT do that will > cause thread headaches.. (maybe static variables)? > 3. What techniques can I use to go about testing thread saftey? > > I'm not asking anything in reference to rails. This would be just > general Ruby thread safety ideas.. > > thanks.. > -- > Posted viahttp://www.ruby-forum.com/.