Re: [OT] error running p_threads
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 15:45:34 +1300
coconut1986@xxxxxxxxx wrote:
Please don't top post.
On 11月20日, 上午7时29分, "Ivar" <ravi.sath...@xxxxxxxxx> wrote:While the cause is correctly identified, the off topic advice is unwise.
I guess the problem is that sub-thread end with the main thread ends,
}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...
maybe you can add one line in the main function:
int main(int argc, char** argv) {
printf("We've reached here!\n");
pthread_create(&thread_id,NULL,threadtest,NULL);
while(1);
}
Look up pthread_join() to replace the while.
This question should have been posted to comp.programming.threads.
--
Ian Collins.
.
- References:
- error running p_threads
- From: Ivar
- Re: error running p_threads
- From: coconut1986@xxxxxxxxx
- error running p_threads
- Prev by Date: regcomp (regex.h) - is it needed to free memory?
- Next by Date: Re: HOW CAN WE GET THE ADMINISTRATOR PASSWORD?
- Previous by thread: Re: error running p_threads
- Next by thread: Re: error running p_threads
- Index(es):
Relevant Pages
|
|