472,962 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,962 software developers and data experts.

pthreads and gdb?

I have made a simple pthread program. In main I create a pthread that
has a startroutine as argument which adds two integers. The output is
correct so I guess the threas runs this startroutine. But when I try to
use gdb on the program it never jumps to the start routine, it just
goes through the main function and then returns. I use emacs on Ubuntu
and normaly a little arrow indicates where I am in the code. Why does
this arrow not move to the start routine?

Feb 23 '06 #1
5 2677
blop wrote:
I have made a simple pthread program. In main I create a pthread that
What is a `pthread`? Do you have a C Standard reference for it?
has a startroutine as argument which adds two integers. The output is
correct so I guess the threas runs this startroutine. But when I try to
use gdb on the program it never jumps to the start routine, it just
goes through the main function and then returns. I use emacs on Ubuntu
and normaly a little arrow indicates where I am in the code. Why does
this arrow not move to the start routine?


<OT>
It must be stuck! You need to oil the little gears to the left of the
power switch.
</OT>

--
BR, Vladimir

Feb 23 '06 #2
Hi,
When you use gdb to debug a thread, you should use attach following
the PID to attach the program.

Feb 23 '06 #3

0peng...@gmail.com wrote:
Hi,
When you use gdb to debug a thread, you should use attach following
the PID to attach the program.


a) Quote what and who you're replying to
b) This whole thing is horribly off topic

Please go to a better suited group. If you look around (which none of
you seem to have done) you'll realise this group is dedicated to
Standard C, and not gdb or threads.

--
BR, Vladimir

Feb 23 '06 #4
"blop" <fe******@yahoo.dk> writes:
I have made a simple pthread program. In main I create a pthread that
has a startroutine as argument which adds two integers. The output is
correct so I guess the threas runs this startroutine. But when I try to
use gdb on the program it never jumps to the start routine, it just
goes through the main function and then returns. I use emacs on Ubuntu
and normaly a little arrow indicates where I am in the code. Why does
this arrow not move to the start routine?


Standard C doesn't have threads. If a search of the gdb documentation
doesn't aswner your question, try one of the gdb mailing lists at
<http://www.gnu.org/software/gdb/mailing-lists/>.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '06 #5
blop wrote
(in article
<11********************@z34g2000cwc.googlegroups.c om>):
I have made a simple pthread program. In main I create a pthread that
has a startroutine as argument which adds two integers. The output is
correct so I guess the threas runs this startroutine. But when I try to
use gdb on the program it never jumps to the start routine, it just
goes through the main function and then returns. I use emacs on Ubuntu
and normaly a little arrow indicates where I am in the code. Why does
this arrow not move to the start routine?


It's off-topic. See comp.programming.threads.

hint: look up pthread_join().
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Feb 23 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: john | last post by:
Hi, I've heard that the lack of performance of JAVA on HP-UX 11.0 is due to bad implementation of pthreads. It should be solved in HP-UX 11.11. Can anyone tell me if this is true ? thanks,...
0
by: Kevin Dahlhausen | last post by:
I've been playing with pySonic on unix. PySonic is pyrex wrapper around the fmod sound library. Fmod is distributed as a shared library that uses pthreads. I am getting a segfault when a...
3
by: Savagesmc | last post by:
Problem Background: I am working on a thin wrapper for the pthreads interface on linux, and have encountered frustrating behavior. The idea is to have a "PosixThread" class that any class can...
5
by: Arnd Schroeter | last post by:
Hello! I am a c++ programmer under the os linux. I am using pthreads and i am wondering why i can only use satic methods of a class to create a thread of it. How can i change this, because it...
15
by: John David Ratliff | last post by:
Maybe someone here can help me. I want to use C++, but pthreads seems to be nonfunctional in it. The following test code I've written in C and C++. The C version works, while the C++ one does...
2
by: Jack | last post by:
hi all I would find a parallel sorting algorithms written with pthread programs, as a benchmark to run. Any pointing will be of help thankyou in advance
2
by: um | last post by:
When the POSIX pthreads library for w32 release 2-2-0 (http://sources.redhat.com/pthreads-win32/) is compiled with VC++6 then it compiles and passes all the benchmark tests in the subdirectory...
5
by: Ed L. | last post by:
Is this pthreads warning of any concern? gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -pthread -pthreads -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS...
8
by: Matt England | last post by:
My team currently using Boost Threads, but we are considering switching to ZThreads. (We seek cross-platform, C++ multithreading capabilities in an external library.) ZThread(s): ...
4
by: Neel | last post by:
Hi, I 'm facing some prob with creating pthreads. My requirement is to create threads in a loop. but I dont want to make an array of pthread. At anytime I want to have 5 threads (I used a...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.