[plt-scheme] Threading problem on OS X

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Oct 28 17:27:32 EDT 2005

At Thu, 27 Oct 2005 22:56:34 -0400, Jon Rafkind wrote:
> But in this case I cannot do that since I have to call the special OS X 
> thread first and then I can init Allegro. Ok so my hackish solution is 
> to start a Scheme thread that calls the OS X thread and then call init 
> Allegro as normal.
> 
> (thread (lambda () (start-OS-X-thread))
> (init)

Does `start-OS-X-thread' create a new OS thread?

> And for reference, inside the OS X thread is basically the following 
> pseudo-C code
> 
> void osx(){
>    while ( 1 ){
>       update_cocoa_stuff();
>       usleep( 10000 );
>   }
> }

In other words, is this the implementation of `start-OS-X-thread', or
is it the function that is run in a new OS thread created by
`start-OS-X-thread'?

I would assume the latter (a new OS X thread that never calls back into
Scheme), but then I don't know why it doesn't work.

Matthew



Posted on the users mailing list.