Threads

Stefan Chekanov d-bross at evrocom.net
Mon Sep 29 09:52:33 PDT 2003


Hi,

Sorry for bothering you.

I am developing an application for FreeBSD that utilizes multiple threads.
It works fine, except that after some minutes of work most of the threads
suddenly stop.

I have examined the stack and found that most of the threads have this stack
#0 ... in _thread_kern_sched() from /usr/lib/libc_r.so.4
#1 ... in _thread_kern_sched_state() from /usr/lib/libc_r.so.4
#2 ... in _thread_fd_lock_debug() from /usr/lib/libc_r.so.4
#3 ... in _close() from /usr/lib/libc_r.so.4
#4 ... in _res_close() from /usr/lib/libc_r.so.4
#5 ... in res_send() from /usr/lib/libc_r.so.4
#6 ... in res_query() from /usr/lib/libc_r.so.4
#7 ... in res_querydomain() from /usr/lib/libc_r.so.4
#8 ... in res_search() from /usr/lib/libc_r.so.4
#9 ... in _gethostbydnsname() from /usr/lib/libc_r.so.4
#10 ... in gethostbyname2() from /usr/lib/libc_r.so.4
#11 ... in gethostbyname() from /usr/lib/libc_r.so.4

and one trhead with this stack

#0 ... in _thread_sys_poll() from /usr/lib/libc_r.so.4
#1 ... in _thread_kern_sched_state_unlock() from /usr/lib/libc_r.so.4
#2 ... in _thread_kern_scheduler() from /usr/lib/libc_r.so.4
#3 0x0 in ??()

Does anybody have an idea what might cause threads to stop?
Is it possible that sockets library is not threads safe?
Especially the part that is used to resolve hostnames?

Any help/idea is welcome.

Thank you in advance.

Best regards,
Stefan
----------



More information about the freebsd-threads mailing list