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

Re: A thread nightmare...Please help.



> -----Original Message-----
> From: adavis@ubasics.com
> Sent: Fri, 23 Mar 2007 07:53:27 -0400
> To: ejr@inbox.com
> Subject: Re: A thread nightmare...Please help.
> 
> As this isn't embedded debian specific, you'll probably not get much help
> here.  Look for a more appropriate list.
> 
> I can't help you much.  You don't tell us what programming language
> you're
> using, which thread library, or how you're calling and closing your
> threads.
> 
> A created thread doesn't "stop" until it returns.  How do you know that
> the
> thread has stopped?  Could it merely be stalled?  Did it return or error
> out?
> 
> What's different about the way you call the second thread?  Are you
> running
> into resource problems - ie, are the threads fighting for a shared
> resource?
> 
> Do example threading programs that can find on the internet show the same
> problem?  If not, what is different about how they are called, stopped,
> and
> terminated?
> 
> Multi-threaded applications are non-trivial.  Make sure you understand
> threads, resource sharing, etc inside and out or you'll run into similar
> problems later that are much harder to debug.


Hi Adam,
Thanks for your suggestions.
I know these are not easy problems to diagnose but I was hoping someone may have run across it before. Or perhaps someone could point me to the pthread source I can look at. I've been looking for it but not successfull so far.

I've narrowed the problem to reallocation of some memory when they have been freed.
I have three main memory mallocs' which were freed then reallocated. For some strange reason, malloc is failing. Although free() does not return a value, I assume the memory have been freed. However, when I reallocate the memory using the same pointer it's failing.
Any ideas there?

Thanks,
--jr.



> 
> On 3/22/07, Junior <ejr@inbox.com> wrote:
>> 
>> Hi All,
>> I have a wierd problem thak came back to bite me in the you know where
>> and
>> I would appreciate any help.
>> 
>> A while ago I noticed that if I have two thread in a program (i.e the
>> main
>> routine and a second thread created from the main) the second thread
>> never
>> runs or runs only once. I got around this by creating another thread and
>> everything was going well. That is, until I forgot about it.
>> I've been fighting with the problem since It bit me again and I'm not
>> sure
>> why this happens and I'm really lost in how to fix it.
>> Does anyone have any ideas?
>> 
>> Much thanks,
>> --Jr.
>> 
>>

____________________________________________________________
ONE-CLICK WEBMAIL ACCESS - Easily monitor & access your email accounts!
Visit http://www.inbox.com/notifier and check it out!



Reply to: