Hi, Can anyone tell me if it is possible to cancel a thread using boost.thread library? Thanks Pshemek -------------------------------------------------------- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ --------------------------------------------------------
Sliwa, Przemyslaw (London) wrote:
Can anyone tell me if it is possible to cancel a thread using boost.thread library? Form Boost.Thread FAQ:
Q: Why isn't thread cancellation or termination provided? A: There's a valid need for thread termination, so at some point Boost.Threads probably will include it, but only after we can find a truly safe (and portable) mechanism for this concept. Regards, -- Janusz
The ZThreads library supports thread cancellation, but I haven't tried it. Does anyone who have an experience with both libraries could share what he thinks of each one? Regards -- Charles ----- Original Message ----- From: Janusz Piwowarski To: boost-users@lists.boost.org Sent: Tuesday, August 30, 2005 11:52 AM Subject: Re: [Boost-users] Thread cancellation Sliwa, Przemyslaw (London) wrote:
Can anyone tell me if it is possible to cancel a thread using boost.thread library? Form Boost.Thread FAQ:
Q: Why isn't thread cancellation or termination provided? A: There's a valid need for thread termination, so at some point Boost.Threads probably will include it, but only after we can find a truly safe (and portable) mechanism for this concept. Regards, -- Janusz
Im just starting to use boost::lambda an boost::lambda::bind, and I do not understand why this do not work whith valarray : namespace std{ class CToto{ public: CToto(double _i): a(_i) {} CToto(): a(0.0) {} double get() const {return a;} private: double a; }; std::vector<std::CToto *> aTotoPtrVect; aTotoPtrVect.push_back(new std::CToto(1.1)); aTotoPtrVect.push_back(new std::CToto(2.2)); aTotoPtrVect.push_back(new std::CToto(3.3)); aTotoPtrVect.push_back(new std::CToto(4.4)); std::vector <double> dv(std::distance((aTotoVect.begin(), aTotoVect.end()); std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // work fine std::valaray <double> dvv(std::distance((aTotoVect.begin(), aTotoVect.end()); std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dvv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // do not work Is someone could explain me that ? --------------------------------- Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez le ici !
Pierre viallet <pviallet@yahoo.fr> writes:
Im just starting to use boost::lambda an boost::lambda::bind, and I do not understand why this do not work whith valarray :
<snip> http://www.boost.org/more/discussion_policy.htm#effective Thanks, -- Dave Abrahams Boost Consulting www.boost-consulting.com
On Aug 30, 2005, at 7:25 AM, Pierre viallet wrote:
I’m just starting to use boost::lambda an boost::lambda::bind, and I do not understand why this do not work whith valarray : namespace std{ class CToto{ public: CToto(double _i): a(_i) {} CToto(): a(0.0) {} double get() const {return a;} private: double a; }; std::vector<std::CToto *> aTotoPtrVect; aTotoPtrVect.push_back(new std::CToto(1.1)); aTotoPtrVect.push_back(new std::CToto(2.2)); aTotoPtrVect.push_back(new std::CToto(3.3)); aTotoPtrVect.push_back(new std::CToto(4.4)); std::vector <double> dv(std::distance((aTotoVect.begin(), aTotoVect.end()); std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // work fine std::valaray <double> dvv(std::distance((aTotoVect.begin(), aTotoVect.end()); std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dvv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // do not work
Probably, because BLL does not know about valarray, and doesn't know what the return type of [] should be. I haven't tested this, but you can try wrapping bll::var(dvv)[bll::var(uiIdx)++] with bll::ret as follows : bll::ret<double&>(bll::var(dvv)[bll::var(uiIdx)++]) Best, Jaakko Järvi
Is someone could explain me that ?
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez le ici ! _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (6)
-
Charles BROSSOLLET
-
David Abrahams
-
Janusz Piwowarski
-
jarvi
-
Pierre viallet
-
Sliwa, Przemyslaw (London)