error running p_threads



Hi,
So basically in my application I have a a main function that does
this...

//Global variables
pthread_t thread_id;

void* threadtest(void * arg) {
while(1) {
printf("Reached this segment\n");
}
return NULL;
}


int main(int argc, char** argv) {
....
printf("We've reached here!\n");
//Line 500

pthread_create(&thread_id,NULL,threadtest,NULL); //Line 501
....
}


So basically, when I run this code, I dont have my "Reached this
segment" line print out to console (so basically I feel the thread is
not being entered). But when I run in gdb, put a break point at line
500 in main (as shown below) and continue stepping, I reach the thread
code and get no errors....What could be the reason that I see no thread
output?? Is it even getting there? Sorry for my english...I can explain
anything more in detail if necessary...

-Ravi

.



Relevant Pages

  • error with pthreads
    ... void* threadtest(void * arg) { ... But when I run in gdb, put a break point at line ... 500 in main and continue stepping, ...
    (comp.programming.threads)
  • Re: error with pthreads
    ... Ivar wrote: ... void* threadtest(void * arg) { ... But when I run in gdb, put a break point at line ...
    (comp.programming.threads)
  • Still need help trying to compile npasswd-2.05
    ... creates /usr/lib/passwd and installs npasswd and its support utilities therein. ... Changing password for smf on unix.smfabac.com ... and running gdb npasswd I get: ...
    (comp.unix.sco.programmer)
  • Need help trying to compile npasswd-2.05
    ... creates /usr/lib/passwd and installs npasswd and its support utilities therein. ... Changing password for smf on unix.smfabac.com ... and running gdb npasswd I get: ...
    (comp.unix.sco.misc)
  • how to automatically print a backtrace of an application on segfault
    ... it automacally calls gdb and print a backtrace a the application before ... I first tested a solution using signals and the backtrace function ... print_trace(const int sig) ...
    (comp.unix.programmer)