[thread][1.35.0] Updated win32 condition variable implementation
Hi all, Apologies to those who have been experiencing problems using boost.thread condition variables on Windows. I have checked in a new tentative fix to SVN trunk, and would be grateful if people could put it through its paces. Thank you for your patience, Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Anthony Williams
Hi all,
Apologies to those who have been experiencing problems using boost.thread condition variables on Windows. I have checked in a new tentative fix to SVN trunk, and would be grateful if people could put it through its paces.
Do these problems also occur on the 1.34.1 branch? I would be grateful if you could provide patches for the 1.34.1 branch and the 1.35.0 branch as http downloads. No access via svn via the firewall over here ... Weekly svn snapshots ... ? Markus
Markus Werle
Anthony Williams
writes: Hi all,
Apologies to those who have been experiencing problems using boost.thread condition variables on Windows. I have checked in a new tentative fix to SVN trunk, and would be grateful if people could put it through its paces.
Do these problems also occur on the 1.34.1 branch?
No. I have changed the condition variable implementation in 1.35.0, in part to provide support for condition_variable_any, and the change to boost.datetime for timeouts, and in part because there were certain properties of the 1.34.1 algorithm I thought were suboptimal. As a last resort, I could reimplement the 1.34.1 algorithm.
I would be grateful if you could provide patches for the 1.34.1 branch and the 1.35.0 branch as http downloads. No access via svn via the firewall over here ...
I've attached a patch for boost/thread/win32/condition_variable.hpp vs the 1.35.0 release to this email. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
Hello,
I'd like to define some events of my state machine as templates that would be instantiated just before posting to the state machine. However, it seems that there is no way to define reactions with unspecialized templates, so I have to specialize them at the stage of reaction definition. The way to do this I can think about is to parametrize the state machine itself. But this means parametrizing *all* the states:
template<class MyType> class MyFSM : public sc::asynchronous_state_machine
Hi Igor
I'd like to define some events of my state machine as templates that would be instantiated just before posting to the state machine. However, it seems that there is no way to define reactions with unspecialized templates, so I have to specialize them at the stage of reaction definition.
Right, for a reaction you have to specify a actual type, not a template.
The way to do this I can think about is to parametrize the state machine itself. But this means parametrizing *all* the states:
Exactly.
Besides, all the state machine then should be defined in the header file.. Do I miss something? Is there some less weird way to do this?
I'm afraid, I don't see any good way how you could do this. May I ask why you'd need to define a reaction for a templated event? Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
Hi Andreas,> > Besides, all the state machine then should be defined in the header> > file..> > Do I miss something? Is there some less weird way to do this?> > I'm afraid, I don't see any good way how you could do this. May I ask why > you'd need to define a reaction for a templated event?>
The application I'm working on is a client that communicates with some proprietry streaming server. The streams are very different in many aspects, so the class representing a stream is designed as a template parametrized by stream type. The above state machine is instantiated from within this parametrized stream class. Basically, the machine is responsible for managing stream states as a result of input events, and propagating "command" objects carried by some events.
In general, such an event is defined as follows:
template
Hi Igor
So I parametrised all the states, moved the implementation to the header file, and... it ceased to compile! Now it says: "1>d:\dev\ servision\projects\windows\thirdparty\boost\boost\statechart\ simple_state.hpp(188) : error C2039: 'inner_context_type' : is not a member of 'StreamSession::Active<StreamType>'"
Where StreamSession is my asynchronous_state_machine, and the Active is the outermost state. The error occures when trying to instantiate the initial inner state of Active.
So I'll appreciate any idea about the cause of the above error,
Have you read http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/faq.html#TemplatedS...?
as well as about the approach in general - is it ok or I missuse the framework.
I don't have a lot of time right now, I'll have a closer look later. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
So I'll appreciate any idea about the cause of the above error,> > Have you read > http://www.boost.org/doc/libs/1_35_0/libs/statechart/doc/faq.html#TemplatedS...
Oh, yes... thank you :) Actually, I've read all the tutorial and FAQ, but, as always, the useful things were written to some bad sectors of the brain... _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Anthony Williams wrote:
Markus Werle
writes: Anthony Williams
writes:
I would be grateful if you could provide patches for the 1.34.1 branch and the 1.35.0 branch as http downloads. No access via svn via the firewall over here ...
I've attached a patch for boost/thread/win32/condition_variable.hpp vs the 1.35.0 release to this email.
NOTE: For future reference, you can access all the SVN files through http directly. For example the above is available here http://svn.boost.org/svn/boost/trunk/boost/thread/condition_variable.hpp. HTH. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org (msn) - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail
Rene Rivera wrote:
Anthony Williams wrote:
Markus Werle
writes: Anthony Williams
writes: I would be grateful if you could provide patches for the 1.34.1 branch and the 1.35.0 branch as http downloads. No access via svn via the firewall over here ... I've attached a patch for boost/thread/win32/condition_variable.hpp vs the 1.35.0 release to this email.
NOTE: For future reference, you can access all the SVN files through http directly. For example the above is available here http://svn.boost.org/svn/boost/trunk/boost/thread/condition_variable.hpp.
D'oh, wrong link. This one should be better http://svn.boost.org/svn/boost/trunk/boost/thread/win32/condition_variable.h.... -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org (msn) - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail
participants (5)
-
Andreas Huber
-
Anthony Williams
-
Igor R.
-
Markus Werle
-
Rene Rivera