November 03, 2010 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 Jonathan M Davis <jmdavisProg@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #797 is|0 |1 obsolete| | --- Comment #8 from Jonathan M Davis <jmdavisProg@gmx.com> 2010-11-02 22:30:04 PDT --- Created an attachment (id=799) Patch for core.thread for linux with changes based off of dmd 2.050. Apparently, I made a couple of errors in my patch, so here's update version. Unfortunately, while these changes seem to fix all of the simple cases that I've tried, my more complicated programs still fail to terminate properly, so there appear to be issues beyond spawned threads being joinable instead of detached. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 03, 2010 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 --- Comment #9 from Jonathan M Davis <jmdavisProg@gmx.com> 2010-11-02 23:52:22 PDT --- Ah, it looks like the problems with my more complex applications have to do with passing functions with incorrect signatures to receive(), so my patch does seem to do the trick (on Linux at least). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 24, 2011 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 Jonathan M Davis <jmdavisProg@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|DMD |druntime OS/Version|Windows |All Severity|normal |major --- Comment #10 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-01-24 03:19:32 PST --- Actually, I'm going to bump this up to major, since spawn is pretty much useless in my experience without this being fixed. Also, I'm 99.99999999999999% sure it's a druntime bug, so I'm moving it to druntime (which I probably would have done before had I noticed that it was marked as dmd). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 25, 2011 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 Sean Kelly <sean@invisibleduck.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |sean@invisibleduck.org --- Comment #11 from Sean Kelly <sean@invisibleduck.org> 2011-01-25 10:53:43 PST --- I don't think threads can start as detached, because the GC needs to interact with them. I'll give this another look though. I also fixed a major timing-related bug since 2.051 was released, which may help here as wells. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 25, 2011 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 --- Comment #12 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-01-25 11:32:30 PST --- I don't know exactly what the GC requires with regards to threads, but when I was talking about starting a thread as detached, I meant detached in the pthreads sense, not the GC sense, like core.thread generally talks about with functions like thread_detachThis(). Spawned threads obviously need to be attached to the GC. The problem is that they can't have to be joined unless there's somehow a thread somewhere which cleans them up. Spawned threads are essentially supposed to clean themselves up and go away when they terminate, and that essentially means that they need to be detached in the pthread sense, since the programmer isn't going to have the parent thread join it when it's done. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 03, 2011 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 --- Comment #13 from Sean Kelly <sean@invisibleduck.org> 2011-02-03 15:51:51 PST --- Fixed in the current revision. The threads exit with a MessageMismatch exception though, which seems like a QOI issue. They should probably exit with an OwnerTerminated message instead (which is the message that triggered the mismatch). I've just changed the behavior so LinkTerminated and OwnerTerminated messages are still thrown as-is instead of being considered a MessageMismatch. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 04, 2011 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 --- Comment #14 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-02-03 22:39:19 PST --- What about joining the spawned threads? From what I recall, there was no place that join was called on them, so if I understand correctly, they'll continue to exist until the program terminates. And I believe that there are a finite number of threads allowed at one time, so it would be a problem if spawned threads continued to exist after they're done executing. If spawned threads are joinable, they need to be joined or they'll never actually terminate (with pthreads anyway) - unless I'm misunderstanding something. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 21, 2013 [Issue 4307] spawn()'ed thread doesn't terminate | ||||
---|---|---|---|---|
| ||||
Posted in reply to torhu@yahoo.com | http://d.puremagic.com/issues/show_bug.cgi?id=4307 Jonathan M Davis <jmdavisProg@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #15 from Jonathan M Davis <jmdavisProg@gmx.com> 2013-05-21 01:01:19 PDT --- I believe that this has been long since fixed - certainly all of the programs here seem to work properly. If someone runs into similar problems, please open a new bug for them. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation