[Haskell-cafe] Re: -threaded

Simon Marlow simonmarhaskell at gmail.com
Fri Dec 14 09:32:14 EST 2007


Ketil Malde wrote:
> Simon Marlow <simonmarhaskell at gmail.com> writes:
> 
>> Concurrency is supported just fine without -threaded.  You need
>> -threaded if you want to:
>   :
>>  3) write a multithreaded Haskell library or DLL
> 
> I thought -threaded (A.K.A. -smp, no?) only affected which runtime was
> used, and thus was a linking option.  I do have a library that needs
> -smp, but as far as I knew, the onus would be on the *applications* to
> specify this when compiling/linking.  Is that incorrect?  Is there a
> way for a library to inform the application about this?

Sorry, I was a bit ambiguous there: for case (3) I mean a Haskell library 
that you intend to call from C, or some other foreign language, using 
multiple OS threads.  You're absolutely right that for a Haskell library 
that you intend to call from Haskell, the -threaded option is used when the 
final program is linked, there's no way for the library itself to add it.

Cheers,
	Simon


More information about the Haskell-Cafe mailing list