digitalmars.D - GC- and thread-related deadlock
- klickverbot (30/30) Sep 20 2010 Hi all,
- klickverbot (2/2) Sep 20 2010 Might possibly be related:
- Sean Kelly (2/6) Sep 20 2010 Thanks for the stack trace! The cause wasn't immediately obvious so I'v...
Hi all,
any idea why the following sample deadlocks on Linux x86_64?
(GDB stacktraces: http://gist.github.com/587964)
---
module test;
import core.thread;
import std.conv;
import std.range;
import std.string;
enum THREADS = iota(0, 9);
enum WORK_RANGE = iota(0, 30000);
void main() {
Thread[] threads;
// Invoke the threads.
foreach (i; THREADS) {
auto thread = new Thread(&run);
threads ~= thread;
thread.start();
}
// Wait for the threads to finish.
foreach (i, thread; threads) {
thread.join(true);
}
}
void run() {
foreach (i; WORK_RANGE) {
string data = to!string(toStringz("Some random string which
contains some random words."));
}
}
Sep 20 2010
Might possibly be related: http://d.puremagic.com/issues/show_bug.cgi?id=4890,
Sep 20 2010
klickverbot Wrote:Hi all, any idea why the following sample deadlocks on Linux x86_64? (GDB stacktraces: http://gist.github.com/587964)Thanks for the stack trace! The cause wasn't immediately obvious so I've made a bunch of speculative changes to see if they fix the issue. Once I get a Linux VM set up here I'll see whether they've helped.
Sep 20 2010









klickverbot <see klickverbot.at> 