Building latest Unix VM - how?

Marcel Weiher marcel at metaobject.com
Sun Jan 20 14:37:15 UTC 2002


Now I remember why I was uncomfortable with using signal-based timers 
and chose to go for NSRunLoop timers instead...

On Samstag, Januar 19, 2002, at 07:05  Uhr, Lex Spoon wrote:

> For the particular problem you mention, there actually is a better
> system in the VM based on itimers.  However, it's disabled by default!
> The problem is that signals start coming in, and on most Unices this
> causes system calls to get interrupted.  In Squeak the problem manifests
> as primitives failing at random times.
>
> The way to fix it is to put a while loop around every system call, and
> repeat it until it returns something other than EINTR.  For example,
> instead of:
>
> 	fd = open(filename, O_RDONLY);
>
> Do this:
>
> 	while((fd = open(filename, O_RDONLY)) < 0
> 	      &&  errno == EINTR)
> 		;
>
>
> Yes, with *every* system call....  Yay Unix!  Some Unices have
> improvements on this state, but I think that many do not, and so this
> must be done the hard way to be portable.




More information about the Squeak-dev mailing list