Which plugins for OSProcess?
John M McIntosh
johnmci at smalltalkconsulting.com
Tue Jan 30 18:57:17 UTC 2007
On Jan 30, 2007, at 4:27 AM, David T. Lewis wrote:
> That said, that actual lockup appears to be happening in AioPlugin,
> which invokes the aio functions in the VM. The aio functions depend
> on select(), and it looks like this is where you are hanging up.
> I certainly can't think of anything in the 3.9 image (versus 3.8)
> that could be triggering it, so it seems more likely to be something
> in the VM, either the AIO plugin or the underlying aio functions.
I noted in the 3.9 unix source code has HAVE_NANOSLEEP defined and
when the VM sleeps we
call nanosleep() then aioPoll twice with the value of zero. But then
aioPoll() returns early since the value is
zero and it never invokes select().
Perhaps some unix folks can comment if there are any interesting side
effects of this behaviour, such as never calling select()
I'll note issues with MC servers based on 3.9 where they hang, and
a swirl of a mouse on a VNC display of their X-11 display restores
functionality.
int aioSleep(int microSeconds)
{
#if defined(HAVE_NANOSLEEP)
if (microSeconds < (1000000/60)) /* < 1 timeslice? */
{
if (!aioPoll(0))
{
struct timespec rqtp= { 0, microSeconds * 1000 };
struct timespec rmtp;
nanosleep(&rqtp, &rmtp); /* EINTR here, but likely we want to
wake up? */
microSeconds= 0; /* poll but don't block */
}
}
#endif
return aioPoll(microSeconds);
}
/* answer whether i/o becomes possible within the given number of
microSeconds */
int aioPoll(int microSeconds)
{
int fd, ms;
fd_set rd, wr, ex;
FPRINTF((stderr, "aioPoll(%d)\n", microSeconds));
DO_TICK();
/* get out early if there is no pending i/o and no need to
relinquish cpu */
if ((maxFd == 0) && (microSeconds == 0))
return 0;
rd= rdMask;
wr= wrMask;
ex= exMask;
ms= ioMSecs();
for (;;)
{
struct timeval tv;
int n, now;
tv.tv_sec= microSeconds / 1000000;
tv.tv_usec= microSeconds % 1000000;
n= select(maxFd, &rd, &wr, &ex, &tv);
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Squeak-dev
mailing list
|