Re: Thread in detached state?

2015-11-20 Thread Ish via Digitalmars-d-learn
On Thursday, 19 November 2015 at 22:07:19 UTC, ZombineDev wrote: On Friday, 13 November 2015 at 15:35:11 UTC, Ish wrote: [...] If you're more familiar with pthreads, you can just use them from core.sys.posix.pthread [1]. After all this what core.thread uses on Posix [2]. In general you can

Re: Thread in detached state?

2015-11-19 Thread Ali Çehreli via Digitalmars-d-learn
On 11/19/2015 08:40 AM, Ish wrote: > Does not produce the desired effect. Will you tell us what that is? :) > For 380 threads (Linux limit) it works, for 381 threads it > dies. As I understand it, it hit a limit. Sounds like it works as designed though. I should go read about this topic to

Re: Thread in detached state?

2015-11-19 Thread Ali Çehreli via Digitalmars-d-learn
On 11/19/2015 08:40 AM, Ish wrote: > For 380 threads (Linux limit) it works, for 381 threads it > dies. The program termination is exactly same as in 381 threads > created using spawn(). I've read some more about this. It looks like there are no separate counts or limits for detached versus

Re: Thread in detached state?

2015-11-19 Thread ZombineDev via Digitalmars-d-learn
On Friday, 13 November 2015 at 15:35:11 UTC, Ish wrote: I was directed here from General list, so be patient with me. I am looking for syntax for creating a detached-state thread in the spirit of POSIX thread attribute PTHREAD_CREATE_DETACHED (the thread resources are released on termination

Re: Thread in detached state?

2015-11-19 Thread Ish via Digitalmars-d-learn
On Friday, 13 November 2015 at 19:45:58 UTC, Ali Çehreli wrote: On 11/13/2015 07:35 AM, Ish wrote: [...] I think the following is the idea: import std.stdio; import core.thread; extern(C) void rt_moduleTlsDtor(); void threadFunc() { writeln("Worker thread started");

Thread in detached state?

2015-11-13 Thread Ish via Digitalmars-d-learn
I was directed here from General list, so be patient with me. I am looking for syntax for creating a detached-state thread in the spirit of POSIX thread attribute PTHREAD_CREATE_DETACHED (the thread resources are released on termination and not when the main thread terminates - allows