I just realized -- if fastthread can be included while Mutex-using code is already running, then the definition and replacement of the classes needs to happen atomically. Otherwise, it creates a race condition where a thread can e.g. end up seeing an incompletely defined Mutex class or none at all. fastthread 0.6.1 addresses this by defining the classes and then atomically swapping the constant definitions as a final step. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20061231/5b51a1ca/attachment.bin
On Sun, 31 Dec 2006 02:04:32 -0500 MenTaLguY <mental at rydia.net> wrote:> I just realized -- if fastthread can be included while Mutex-using code > is already running, then the definition and replacement of the classes > needs to happen atomically. Otherwise, it creates a race condition > where a thread can e.g. end up seeing an incompletely defined Mutex > class or none at all. > > fastthread 0.6.1 addresses this by defining the classes and then > atomically swapping the constant definitions as a final step.Very nice mental, I''ll push out new gems for unix and win32 later today. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/ http://www.awprofessional.com/title/0321483502 -- The Mongrel Book http://mongrel.rubyforge.org/ http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.
On 12/31/06, Zed A. Shaw <zedshaw at zedshaw.com> wrote:> On Sun, 31 Dec 2006 02:04:32 -0500 > MenTaLguY <mental at rydia.net> wrote: > > > I just realized -- if fastthread can be included while Mutex-using code > > is already running, then the definition and replacement of the classes > > needs to happen atomically. Otherwise, it creates a race condition > > where a thread can e.g. end up seeing an incompletely defined Mutex > > class or none at all. > > > > fastthread 0.6.1 addresses this by defining the classes and then > > atomically swapping the constant definitions as a final step. > > Very nice mental, I''ll push out new gems for unix and win32 later today. >Hey Zed, I already uploaded the mswin32 gem of fastthread 0.6.1 ... btw, Happy New Year! -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
We should probably get the current fastthread in releases/gems/ too, so people testing the mongrel RCs get the latest ones. -mental -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070101/d40a76c9/attachment.bin