Hi all,
I have a problem with multi-thread. When i intend to create a new thread,
instead of create one thread, it creates TWO threads.
I really don't understand why it is amazing. However, if i tests this on
another computer (the same glibc configuration), it creates only one thread.
It seams that a new created thread automatically creates a new other one.
I send the debug result and the process result (ps -ef).
Thanks and regards,
nary tra
Starting program: /root/thanhtra/project/ipsig/source/main -l ./lib_qos.so
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 28778)]
starting ...
31 pthread_attr_init(&tattr);
(gdb) step
32 pthread_attr_setdetachstate(&tattr,PTHREAD_CREATE_DETACHED);
(gdb) step
33 pthread_create(&libthr, &tattr, librun,NULL);
(gdb) step
[New Thread 32769 (LWP 28780)]
[New Thread 16386 (LWP 28781)]
34 pthread_attr_destroy(&tattr);
(gdb)
root 28777 28683 3 12:22 pts/0 00:00:06 gdb main
root 28778 28777 0 12:23 pts/0 00:00:00 /root/project/source/main -l
./lib_qos.so
root 28780 28778 0 12:23 pts/0 00:00:00 /root/project/source/main -l
./lib_qos.so
root 28781 28780 0 12:23 pts/0 00:00:00 /root/project/source/main -l
./lib_qos.so
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html