pthreads works, sorta
Tue Jun 26 23:41:00 GMT 2001
On Wed, Jun 27, 2001 at 02:31:28AM -0400, Christopher Faylor wrote:
>On Wed, Jun 27, 2001 at 02:51:13PM +0800, Dmitry Timoshkov wrote:
>>"Robert Collins" <email@example.com> wrote:
>>> What does all this mean? We need to catch invalid memroy access, and
>>> ValidQuery was supplied by Chris as a tool to do that.
>>In a multithreaded environment VirtualQuery, IsBad* and similar approaches
>>are wrong. It can't be guaranteed that after a successful test that memory
>>will be still accessable.
>They are not necessarily wrong if they are controlled by appropriate mutexes.
>The file handling code should be protected this way. I don't know about
>the thread code, though.
Actually, this is wrong. I was assuming that access to an object X would
only be by well-behaved manipulators of object X. It's possible for a rogue
thread to do something odd with a wild pointer and still screw up memory.
So SEH is the only safe way to handle this. However, I don't think that SEH
will actually work in the Cygwin DLL.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
More information about the Cygwin