From: Francis Cianfrocca Date: 2006-10-27T05:38:22+09:00 Subject: Re: threads ------=_Part_30458_13374978.1161895099475 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/26/06, ara.t.howard@noaa.gov wrote: > > what would the preferrer way by to shared data from http.callback? does > it > need protection? how about sharing with ruby green threads? I'm not exactly sure what you're asking, Ara. What happens in this code is that the HTTP requests are fired off simultaneously, and as they complete, the callback gets called for each completion, always on the same thread. (There are no additional green or native threads being spun here.) So there's no contention and no need for mutex protection. If you wanted for some reason to run this code simultaneously with unrelated code on other threads, then of course you'd use the normal thread-safe procedures to sync this data with your other threads. ------=_Part_30458_13374978.1161895099475--