Program locked at joinAll and sched_yield
tcak via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jul 1 05:02:11 PDT 2016
I have my own Http Server. Every request is handled by a thread,
and threads are reused.
I send 35,000 request (7 different terminals are sending 5000
requests each) to the server again and again (each of them lives
for short).
Anyway, everything works great, there is no problem at all.
I put "readln" in main function. So, when I press enter, all
currently idle threads are stopped. (I use thread.join()).
Problem is that, all threads are stopped, by the last thread
Thread#1 gets locked at sched_yield(), it uses one of CPU cores
at 100%, and program never quits and stays there.
There is only one remaining thread at the end, and below is its
stack trace.
sched_yield() in
/build/glibc-GKVZIf/glibc-2.23/posix/../sysdeps/unix/syscall-template.S:84
thread_joinAll() in
rt_term() in
rt.dmain2._d_run_main(int, char**, extern(C) int(char[][])
function).runAll()() in
rt.dmain2._d_run_main(int, char**, extern(C) int(char[][])
function).tryExec(scope void() delegate)() in
_d_run_main() in
main() in
__libc_start_main(int (*)(int, char **, char **) main, int argc,
char ** argv, int (*)(int, char **, char **) init, void (*)(void)
fini, void (*)(void) rtld_fini, void * stack_end) in
/build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:291
_start() in
Is there any known issue about this? or anything that is known to
cause this problem?
More information about the Digitalmars-d-learn
mailing list