Click to See Complete Forum and Search --> : Multithreaded System On 4 Cpu Linux Machine, process stuck on certain thread


eyalzm
05-10-2004, 11:45 AM
hello All,

i've developed a process that uses 5-20 threads.
after several seconds from start of the program the process hangs
doing only one of the threads work - either main thread or others - but only one.

done the -D_REENTRANT using gcc c++ 3.2 linux redhat 9 .

what am i doing wrong? - on a single cpu machine it works fine
most of the times - there is no core and the process works but for only
one thread.

other info :
vi /proc/version
Linux version 2.4.20-8smp (bhcompile@porky.devel.redhat.com)
(gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 SMP Thu Mar 13 17:45:54 EST 2003

vi /proc/mdstat
Personalities :
read_ahead not set
unused devices: <none>

vi /proc/interrupts
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
0: 84695121 0 0 0 0 0 0 0 IO-APIC-edge timer
1: 1293 0 0 0 0 0 0 0 IO-APIC-edge keyboard
2: 0 0 0 0 0 0 0 0 XT-PIC cascade
8: 1 0 0 0 0 0 0 0 IO-APIC-edge rtc
10: 0 0 0 0 0 0 0 0 IO-APIC-level usb-ohci
12: 8459 0 0 0 0 0 0 0 IO-APIC-edge PS/2 Mouse
14: 6739226 0 1 0 0 0 0 0 IO-APIC-edge ide0
16: 15 0 0 0 0 0 0 0 IO-APIC-level aic7xxx
17: 62997425 0 0 0 0 0 0 0 IO-APIC-level eth0
21: 1328368 0 0 0 0 0 0 0 IO-APIC-level megaraid
NMI: 0 0 0 0 0 0 0 0
LOC: 84689958 84689956 84689937 84689921 84689956 84689956 84689956 84689956
ERR: 0
MIS: 0

vi /proc/modules
ide-cd 35772 0 (autoclean)
cdrom 34176 0 (autoclean) [ide-cd]
lp 9188 0 (autoclean)
parport 39072 0 (autoclean) [lp]
autofs 13684 0 (autoclean) (unused)
tg3 52904 1
ipt_REJECT 3928 0 (autoclean)
iptable_filter 2412 0 (autoclean)
ip_tables 15864 2 [ipt_REJECT iptable_filter]
keybdev 2976 0 (unused)
mousedev 5656 1
hid 22308 0 (unused)
input 6208 0 [keybdev mousedev hid]
usb-ohci 22216 0 (unused)
usbcore 82592 1 [hid usb-ohci]
ext3 73376 2
jbd 56336 2 [ext3]
megaraid 31212 3
aic7xxx 142548 0
sd_mod 13452 6
scsi_mod 110488 3 [megaraid aic7xxx sd_mod

EZ

bwkaz
05-10-2004, 06:45 PM
From your description, it sounds like the other threads are deadlocking. Post your code (I highly doubt it has anything to do with the system libraries or kernel...). Actually, post as little of it as possible to still illustrate what's going on when the threads hang (to find out exactly where they hang, build with the -g switch, and use gdb on the binary; then, run and do whatever you need to do until it hangs, go back to the terminal gdb's running in and hit ctrl-z to stop the running process, then you can use gdb's thread list and thread-switching functionality (along with bt to get a stack backtrace of the current thread) to find out where the threads are hanging up).

eyalzm
05-11-2004, 02:37 AM
i'll reply with the code soon - but just wanted to add that
this code is higly tested on both HPUX and SunOs and works fine
this is why i thought it is something with kernel parameters concerning
threads or other user settings.