[MLton] getrusage and times?

Stephen Weeks MLton@mlton.org
Thu, 14 Jul 2005 18:53:08 -0700


> If I may ask, how did you diagnose the problem?

I guessed immediately that the getrusage came from GCs since it
happened so frequently.  Seeing the times call afterwards helped
because I remembered the kernel bug workaround.  I then figured they
must be happening mistakenly, grepped for SUPPORTS_WEAK, and found
that it wasn't defined.

> You context switch when you hit a blocking operation, which means
> that all blocking operations internally do a nonblocking operation
> and context switch away on EAGAIN until the descriptor becomes
> ready.
...
> My library wraps and replaces Socket for the application. It also
> provides a few (contention-free) synchronization mechanisms and the
> scheduler (epoll currently).

You might want to read Concurrent Programming in SML, which seems
related.

  http://mlton.org/References#Reppy99

> What I was trying to say was that I think doing this around an accept() 
> call is no big deal anyways. 

OK.