[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Debugging multithreaded program on Debian



Even linking with libc6 does not cause multiple threads to work correctly. You
have to link with libpthreads to have threading work correctly (ie, add
-lpthreads).

Though I've not digged to find out the reason, it appears that just linking
libc6 fills in pthread apis without actually doing anything.

A good test to see if threading is working correctly is to test the value
returned from the pthread_self() api. When I linked to just libc6, this always
returned 0, whereas when I linked to libpthreads, this started returning valid
values.

It is *very* cool to see process threads working though.

On 09-Nov-98 alexander.schwartz@gmx.net wrote:
> Hi,
> 
> as the subject tells I would like to debug a multithreaded programm on
> debian. 
> 
> I upgraded gdb (to 4.17-4.m86k.objc.threads.hwwp.fpu.gnat.2), libc6
> (2.0.7.u-4) and ddd-smotif (3.0-1) and after my program starts the
> threads (pthread_create) I am unable to see these tasks (when clicking on
> the proper menu in ddd). Although the task are running with no problems. 
> 
> BTW: I compile my program using g++ unsing the arguments:
>   CFLAGS := -g -Wall -O3 -m486
> 
> What am I doing wrong?
> 
> Thank, Alex.
> 
> --
> Alexander Schwartz
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org <
> /dev/null

----------------------------------
E-Mail: Geoffrey L. Brimhall <brimhall@pobox.com>
Date: 11-Nov-98
Time: 15:20:31

This message was sent by XFMail
----------------------------------


Reply to: