[Haskell-cafe] Re: Waiting for thread to finish

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Nov 29 14:00:31 EST 2007


On Nov 29, 2007, at 13:38 , Andrew Coppin wrote:

> Bryan O'Sullivan wrote:
>> But wait, there's more!  If you're using the threaded RTS, you  
>> often need to know how many threads you can run concurrently, for  
>> example to explicitly split up a compute-bound task.  This value  
>> is exposed at runtime by the numCapabilities variable in the  
>> GHC.Conc module.
>>
>> http://www.haskell.org/ghc/docs/latest/html/libraries/base-3.0.0.0/ 
>> GHC-Conc.html#v%3AnumCapabilities
>>
>> This variable is new in GHC 6.8.1 (thanks, Simon!), so don't try  
>> to use it with an older release.
>
> Hmm... I was *sure* this was exposed in Control.Concurrent  
> already... but, apparently, no. It seems you can only get at it  
> from GHC.Conc. That's kind of a pitty... oh well! ;-)

It's internal implementation foo; why would it be part of an  
interface intended to be reasonably portable?

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list