Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Kagamin via Digitalmars-d-learn
https://dlang.org/phobos/core_thread.html#.Thread.join

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Kagamin via Digitalmars-d-learn
Yep, munching an Error by default is pretty nasty.

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/5/16 12:06 PM, Kagamin wrote: https://dlang.org/phobos/core_thread.html#.Thread.join Yeah, but in the meantime, the thread state is not cleaned up, and it's in the same memory space as everywhere else. I don't see why if you have an out-of-bounds error in the main thread, it should

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Ali Çehreli via Digitalmars-d-learn
On 02/04/2016 10:41 PM, tcak wrote: > On Friday, 5 February 2016 at 06:23:09 UTC, Daniel Kozak wrote: >> V Fri, 05 Feb 2016 03:47:40 + >> tcak via Digitalmars-d-learn >> napsáno: >> >>> [...] >> >> Did you try catch Throwable instead of Exception? I was

Re: What reasons are known a thread stops suddenly?

2016-02-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/5/16 2:59 AM, Ali Çehreli wrote: On 02/04/2016 10:41 PM, tcak wrote: > On Friday, 5 February 2016 at 06:23:09 UTC, Daniel Kozak wrote: >> V Fri, 05 Feb 2016 03:47:40 + >> tcak via Digitalmars-d-learn >> napsáno: >> >>> [...] >> >> Did you try

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread Ali Çehreli via Digitalmars-d-learn
On 02/04/2016 12:25 PM, tcak wrote: > void threadFunc(){ > scope(exit){ > writeln("Leaving 2: ", stopRequested); > } > > > while( !stopRequested ){ > /* THERE IS NO "RETURN" HERE AT ALL */ > } > > writeln("Leaving 1: ", stopRequested); > } > > > > While loop is

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Friday, 5 February 2016 at 06:23:09 UTC, Daniel Kozak wrote: V Fri, 05 Feb 2016 03:47:40 + tcak via Digitalmars-d-learn napsáno: [...] Did you try catch Throwable instead of Exception? Undid the fix, and wrapped the problem causing function call

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread Daniel Kozak via Digitalmars-d-learn
V Fri, 05 Feb 2016 03:47:40 + tcak via Digitalmars-d-learn napsáno: > On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: > > On 02/04/2016 12:25 PM, tcak wrote: > > > > > void threadFunc(){ > > > scope(exit){ > > >

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: On 02/04/2016 12:25 PM, tcak wrote: > void threadFunc(){ > scope(exit){ > writeln("Leaving 2: ", stopRequested); > } > > > while( !stopRequested ){ > /* THERE IS NO "RETURN" HERE AT ALL */ > } > >

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
On Friday, 5 February 2016 at 03:47:40 UTC, tcak wrote: On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: On 02/04/2016 12:25 PM, tcak wrote: > [...] That would happen when there is an exception. > [...] If a thread is terminated with an exception, its stack is unwound and

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread Daniel Kozak via Digitalmars-d-learn
V Fri, 05 Feb 2016 05:48:27 + tcak via Digitalmars-d-learn napsáno: > On Friday, 5 February 2016 at 03:47:40 UTC, tcak wrote: > > On Thursday, 4 February 2016 at 22:27:31 UTC, Ali Çehreli wrote: > >> On 02/04/2016 12:25 PM, tcak wrote: > >> > >> > [...]

What reasons are known a thread stops suddenly?

2016-02-04 Thread tcak via Digitalmars-d-learn
I have implemented a standalone HTTP server. So everything is in single executable. Requests come, for responding a new thread is started, etc. To listen new socket connections, and socket events, a single thread is used (Call this event listener thread). Everything works perfectly. Firefox

Re: What reasons are known a thread stops suddenly?

2016-02-04 Thread ikod via Digitalmars-d-learn
On Thursday, 4 February 2016 at 20:25:27 UTC, tcak wrote: Is there any known reason for a thread to suddenly stop like this? Your listener object can be GC-ed. Check if you have any live ref to it.