[Vm-dev] Re: Delays should wakeup the idle process (patch)

Craig Latta craig at netjam.org
Sat Jul 16 09:08:14 UTC 2011


Hi John--

> The pthread_cond_timedwait (yes I did that years back) won't fly
> because you miss the interrupt from socket/files/UI which leaves to
> the odd behavior if squeak is busy good web server, if squeak is idle
> the bad web server...   "it always sends at 50 packets per second "

     In Spoon (the Flow plugin, really), when I signal an external
semaphore associated with a socket or whatever when activity happens, I
also signal the "activity" mutex that this pthread_cond_timedwait call
is waiting on. It works fine; in fact, I had to make this work well, to
wake up frequently for socket activity for remote messaging on headless
systems.

     At the time I wrote it, the Unix and Mac VMs remote messaging
performance was horrible over this very issue. I also experimented with
alternative calls, including select(), and nanosleep().
pthread_cond_timedwait() beat them handily. The aioPoll() stuff just
seems like a confusing mess.

     Also, having this as a named primitive in an external plugin has
been very convenient, for enabling this sort of experimentation without
having to restart the virtual machine.


-C

--
Craig Latta
www.netjam.org/resume
+31   6 2757 7177
+ 1 415  287 3547




More information about the Vm-dev mailing list