[racket] Racket FFI lets other threads run?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jul 9 10:34:57 EDT 2011

At Sat, 09 Jul 2011 15:18:09 +0200, Stephan Houben wrote:
> I understand that (barring use of features like places or futures)
> Racket threads normally do not run truly concurrently.

Right --- not "truly concurrently" from the OS/machine perspective.

> But what about C functions called through the FFI?

A C function could start or use an OS-level thread, but the FFI doesn't
create any new OS threads itself.

> I that _fun has an option like #:atomic? ;
> does this mean that the default behaviour is that the C function
> runs non-atomically, that is, concurrently with other threads?

No. An `#:atomic? #t' modifier makes a callback from C run atomically
with respect to all Racket threads (in a given place). It has no effect
on calls into C, though.

Posted on the users mailing list.