[FIX][SF][VM][UNIX] VM 2.8a

Stephan Rudlof sr at evolgo.de
Mon Jul 10 22:23:47 UTC 2000


New Unix_2.8 alpha_02 in SourceForge: added fairly portable sleep if
there isn't a socketPollFunction (see below).

Avoids eating of processor cycles...

Stephan


src/sqXWindow.c:

int ioRelinquishProcessorForMicroseconds(int microSeconds)
{
  /* sleep in select() for immediate response to socket i/o */
#ifdef HEADLESS
  if ( socketPollFunction ) { socketPollFunction(microSeconds,0);}
  /* aioPollForIO(microSeconds, 0); */
#else
  if ( socketPollFunction ) { socketPollFunction(microSeconds,stXfd);}
  /* aioPollForIO(microSeconds, stXfd); */
#endif
  else { /* fairly portable sleep if there isn't a socketPollFunction */
    struct timeval tv;
    tv.tv_sec = microSeconds / 1000000;
    tv.tv_usec = microSeconds % 1000000;
    select(0, NULL, NULL, NULL, &tv);
  }
  return microSeconds;
}

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list