[M3commit] select vs. poll

Jay K jay.krell at cornell.edu
Sat Apr 17 16:20:32 CEST 2010


It is no longer relevant though right?

And hasn't been for over 10 years?

#ifdef and use select optionally?

  Could do that in the C most likely.

  I've actually only built this on Linux and/or Darwin. And checked various manpages...er, at least Solaris. I'd have to double double check Free/Open/NetBSD/Darwin..

 

 

The somewhat fixed limit of select bugs me.

And then it bugs that the Modula-3 is written to work with arbitrary large numbers, but by cloning the headers in a "hidden" way.

With poll we get no cloning and no limit. And since we are only waiting on one fd, we allocate just a fixed tiny amount of memory.

Still to consider the user thread stuff though.

  Gosh, I wonder what OpenBSD pthreads do here...

 

 

 - Jay
 
> From: hosking at cs.purdue.edu
> Date: Sat, 17 Apr 2010 09:15:08 -0400
> To: jkrell at elego.de
> CC: m3commit at elegosoft.com
> Subject: Re: [M3commit] CVS Update: cm3
> 
> Just a historical note. select was 4.2BSD. poll was AT&T System V UNIX. In the bad old days the different Unixes had different APIs. In the early days when Modula-3 user threads were written they were running on BSD systems.
> 
> On 17 Apr 2010, at 12:15, Jay Krell wrote:
> 
> > CVSROOT: /usr/cvs
> > Changes by: jkrell at birch. 10/04/17 12:15:33
> > 
> > Modified files:
> > cm3/m3-libs/m3core/src/thread/Common/: SchedulerPosix.i3 
> > ThreadInternal.c 
> > ThreadInternal.i3 
> > cm3/m3-libs/m3core/src/thread/PTHREAD/: ThreadPThread.m3 
> > cm3/m3-libs/m3core/src/thread/WIN32/: SchedulerPosix.m3 
> > 
> > Log message:
> > switch pthreads and cygwin from select to poll
> > They only wait for one file at a time, so the change is easier.
> > 
> > Leave userthreads using select.
> > It waits for multiple, so the change is a bit more.
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3commit/attachments/20100417/dec8e2b9/attachment-0002.html>


More information about the M3commit mailing list