snapshot 20050114 race (on list)

Pierre A. Humblet pierre.humblet@ieee.org
Mon Jan 17 16:31:00 GMT 2005



Christopher Faylor wrote:

> 
> Thanks.  That script unearthed at least two races in the proc_waiter
> code.  One was a "how in the world could it ever work" type.  I was
> inadvertently relying on the fact that the last process created would be
> the first process to exit.  It's amazing that this passed the test suite.
> I guess I need to beef up that aspect of it.

I had never noticed that procs was an array of pinfo's, and not
an array of pointers to pinfos, and that pinfo's were being copied
when processes terminate and in proc_waiter.

But pinfo's contain a CRITICAL_SECTION and according to
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/initializecriticalsection.asp>:
 A critical section object cannot be moved or copied. 
 The process must also not modify the object, but must treat it
 as logically opaque. Use only the critical section functions to
 manage critical section objects. When you have finished using the
 critical section, call the DeleteCriticalSection function.

I know that the hard way. fhandler_dsp was freezing WinME 
and that was one of the problems (there were several
problems, I never found exactly which was the culprit).

Pierre



More information about the Cygwin-developers mailing list