[Haskell-cafe] How to ensure code executes in the context ofaspecific OS thread?

Donn Cave donn at avvanta.com
Wed Jul 6 19:47:32 CEST 2011


Quoth Brandon Allbery <allbery.b at gmail.com>,
...
> I don't know about the general case, but OS X does treat the main
> thread specially here; the (native, not X11) framework sets up the
> connection to Core Graphics in the main thread before invoking the
> main program, so you can't make whatever it is (thread local storage
> seems likely) happen in a different thread.

For one general case, C++ static constructors run prior to main(),
so any thread dependency introduced by a static C++ object would
target the initial program thread.

	Donn



More information about the Haskell-Cafe mailing list