[M3devel] crummy ThreadWin32.m3 implementation?

Jay jay.krell at cornell.edu
Tue Apr 21 06:41:55 CEST 2009


I'm not keen on it.

Checking the version and having two implementation switched between at initialization would be ok though -- actually using function pointers like so:

 

void DoSomething_v2(void) { }

void DoSomething_v1(void) { }

void DoSomething_init(void)

{

 if (... )

  DoSomething = DoSomething_v1;

else

  DoSomething = DoSomething_v2;

DoSomething();

}

 

void (*DoSomething)(void) = DoSomething_init;

 

Something more if switching multiple pointers though -- switching a pointer to a struct of function pointers.

 

 

 - Jay

 


From: hosking at cs.purdue.edu
To: jay.krell at cornell.edu
Date: Tue, 21 Apr 2009 14:33:29 +1000
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] crummy ThreadWin32.m3 implementation?

Might not be such a bad thing ;-)



On 21 Apr 2009, at 14:14, Jay wrote:

Only if you drop support for pre-Vista versions.
 
 - Jay


 
> From: hosking at cs.purdue.edu
> To: jay.krell at cornell.edu
> Date: Tue, 21 Apr 2009 07:53:57 +1000
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] crummy ThreadWin32.m3 implementation?
> 
> Also, note that win32 now supports CVs directly! No need for 
> semaphores.
> 
> On 20 Apr 2009, at 19:11, Jay wrote:
> 
> >
> > Searching the web...finds this which seems very relevant:
> >
> > http://birrell.org/andrew/papers/ImplementingCVs.pdf
> >
> > - Jay
> >
> >
> >
> > ----------------------------------------
> >> From: jay.krell at cornell.edu
> >> To: m3devel at elegosoft.com
> >> Date: Mon, 20 Apr 2009 08:47:21 +0000
> >> Subject: [M3devel] crummy ThreadWin32.m3 implementation?
> >>
> >>
> >> Um, ThreadWin32.m3 looks pretty crummy -- all LockMutex calls 
> >> bottleneck on one giant lock. .v0 and .v1 aren't bad this way.
> >>
> >>
> >> - Jay
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090421/7aabcd3d/attachment-0002.html>


More information about the M3devel mailing list