Boost logo

Boost Users :

From: Mark Sizer (yg-boost-users_at_[hidden])
Date: 2003-06-06 17:50:29


No problem. I just converted some old threading code to Boost with the
help of the list. I'm glad to be able to free Mr. Kempf for more arcane
discussions :)

- Mark

Dick Bridges wrote:

> I'm afraid this thread was started by one of my "senior moments". When
> reading ~thread() and join(), I flipped a bit and "saw" join() handled
> m_joinable == true and ~thread() handled m_joinable == false. THAT's why I
> thought join() had to be called. Your post caused me to go back and read it
> again. Now I'm *REALLY* embarrassed.
>
> Thanks for getting me started down the right track.
>
> "Mark Sizer" <yg-boost-users_at_[hidden]> wrote in message
> news:3EDE8F0A.1090003_at_15grant.com...
>
>>What is "the right thing"?
>>
>>You don't HAVE to join(). The creating thread will just keep going if
>>you don't. If you join, it waits.
>>
>>If you're passing ownership (e.g. delete responsibility) across thread
>>boundaries, you have to be careful, but that doesn't have much to do
>>with join().
>>
>>After starting the thread, you can use a condtional in the creator to
>>wait for the thread to "get going" and accept ownership, sort of a
>>"started()" rather than an "ended()", like join(). Or you can flip it
>>around and have the started thread wait on the conditional whilst the
>>creator thread continues to use what will eventually be given to the
>>
> thread.
>
>>Is that at all helpful?
>>
>>- Mark
>>
>>dick.bridges_at_[hidden] wrote:
>>
>>
>>>I need to spawn worker threads that simply perform a task and exit. All
>>>the examples I can find seem to use join() to cleanup the thread
>>>
> resources
>
>>>from another thread. Isn't there some way to declare worker threads so
>>>that they "do the right thing" as they exit the thread function?
>>>
>>>TIA
>>>
>>>
>>>
>>>Info: <http://www.boost.org>
>>>Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
>>>Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>>>
>>>
>>>Your use of Yahoo! Groups is subject to
>>>
> http://docs.yahoo.com/info/terms/
>
>>>
>>>
>>>
>>
>>
>>
>>
>>Info: <http://www.boost.org>
>>Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
>>Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>>
>>
>>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
>>
>
>
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net