This should be a not so long question to answer, I hope.

I took an example from the "Programming in D" book, chapter "Message Passing Concurrency", around page 550. The question of interest was, how many threads I can have spawned at the same time. So I made an array of robot objects from the example and found out: the maximum number is different on different PCs I have.
For example:
- on my mac I can have 2048 threads spawned at the same time
- on my linux machine the maximum number is 32192.
The numbers are quite fixed, however there were some small fluctuations on the linux machine.

The questions still remains: how do I know, what maximum number of threads I can have? Is it possible to calculate this value during runtime of my program? The two machines I have available for testing are very different, what is the main parameter which controls the number of possible threads? (CPU maybe? Number of cores? RAM is not I think at the moment...)

Thanks in advance
Alex

Reply via email to