bug-commoncpp
[Top][All Lists]
Advanced

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

Re: Common c++ Thread::notify implementation question.


From: David Sugar
Subject: Re: Common c++ Thread::notify implementation question.
Date: Tue, 04 Mar 2008 15:49:20 -0500
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

When a new thread is created, it records the thread instance it was created from, and this becomes the "parent" reference. However, using notify requires that the parent does not dissapear (get deleted) before it's child, and requires tracking of thread meta data. For these reasons, I actually removed the concept entirely in ucommon. For what you want to do, the safest way would be to rendezvous on a semaphore or event object, or use a signaled conditional.

Jim wrote:
I'm a bit hazy as to what exactly one would do with this method. I'm in need of kicking off a detached thread and somehow being able to tell when it finishes. Since a detached thread is self deleting, it's dangerous to attempt to call any methods after the detach or you risk a segfault.

So I see the parameter to the notify method is the thread that as terminated. I'm not sure of what can be done with it at this point. Is this the same thing you would obtain with a call to the static get method?

The documentation says it "sends a notification to the parent". Can someone explain how this might work? A simple example might be nice.

Thanks,
Jim.


_______________________________________________
Bug-commoncpp mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-commoncpp

Attachment: dyfet.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]