[M3devel] giant lock in SocketWin32.m3?

Jay K jay.krell at cornell.edu
Mon Apr 19 17:31:33 CEST 2010


> Perhaps the network stack on Windows95/98 wasn't really reentrant?


No. Your expectations are much too low.

Imagine if this was true. Then all Windows networking code

would have its own giant locks, and you'd read about this

in documentation and such.


I'm not sure of the terminology, but:

"Reentrant" is a strong word. "Thread safe"
is a weaker more common one. For example strtok
is not reentrant, but typically thread safe,
through use of "thread locals".
You can't use strtok in a nested for loop though.

 

It's not that the code is old per se. I think a lot of it was

slapped together quickly and then not really reviewed or tested much,

and doesn't get much use either.

 

I constantly see incorrect on-demand initialization as well. This code had it as well.


 - Jay

 
> Date: Mon, 19 Apr 2010 16:15:06 +0200
> From: wagner at elegosoft.com
> To: m3devel at elegosoft.com
> Subject: Re: [M3devel] giant lock in SocketWin32.m3?
> 
> Quoting Jay K <jay.krell at cornell.edu>:
> 
> >
> > Anyone know why SocketWin32.m3 has had a giant lock around everything?
> >
> > I see no point to it.
> >
> > The only global variable is related to on-demand initialization.
> >
> > And even that wasn't handled correctly..
> 
> Perhaps the network stack on Windows95/98 wasn't really reentrant?
> 
> Just a guess though. The code is quite old as far as I know.
> 
> Olaf
> -- 
> Olaf Wagner -- elego Software Solutions GmbH
> Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
> phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
> http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100419/85a80f61/attachment-0002.html>


More information about the M3devel mailing list