multithreaded timer?

B

boost_newbie

Hi

I'm implementing a serial RS232 communication centered application
using boost in Windows.

The user actions are translated to ASCII commands to be sent to some
serial devices connected to the serial ports, but as they are quite
slow, I had to implement a command queue, so that as soon as a command
gets its answer, it is cleared and the next one is sent, up to the end
of the queue (of course).

Using boost serial communication features, I realized that I needed an
extra time-out, because the devices are real slow.

So that this low speed doesn't lock up anything, the command queue
runs in a separate thread and I would like another thread to run a
timer, that could be activated when the command is send by the queue
thread, and deactivated by the same thread if it detects an answer
comming from the device in response to its command. If the timer is
due, it shoud send a signal or call a callback function in the queue
thread so it knows that the last command timed-out and it shoud re-
send it again.

All the queue things are OK (so it seems for now), I just need the
timer.

The ASIO timer is quite strange to me, I didn't manage to make it
work.

Any ideas?

Thanks a lot in advance
Francisco
 
B

boost_newbie

boost_newbie said:
I'm implementing a serial RS232 communication centered application
using boost in Windows.
[..]
All the queue things are OK (so it seems for now), I just need the
timer.
The ASIO timer is quite strange to me, I didn't manage to make it
work.
Any ideas?

Well, yes.  Post to the relevant online forum available on the Boost web
site.  Here we talk standard C++ language, and it happens not to have
threaded timers (or anything named ASIO) at this time.

If you are getting compile/link errors, we can help, read FAQ section 5
first (and all of the FAQ while you're at it).

V


Thankyou for your answer and sorry for cross posting.

Francisco
 
A

Arne Mertz

Sorry Victor but I thought from previous discussions here in the past
(or at least my senile memory seems to have a vague recollection of
that), that boost discussions were tolerated here even if not
necessarily encouraged, especially since significant amount of boost
is making it into C++0x.

I understand (and agree with) the need to keep the discussions focused
here but I though boost was allowed.

Yan

My memory might be as senile as yours, it recollects sth. like
"... standard C++ and freely available platform independent
libraries (such as boost and loki)..."

Arne
 
V

Victor Bazarov

Arne said:
My memory might be as senile as yours, it recollects sth. like
"... standard C++ and freely available platform independent
libraries (such as boost and loki)..."

Discussing compiler errors and what to do about them, certainly.
Discussing algorithms and problems related to those algorithms, and
*what to use* from that "platform independent library"? That's not a
*language* area, is it, now?

Anyway, you are free to ignore my opinion, of course. This is, after
all, an unmoderated newsgroup and everybody can post anything. We even
see posts from religious nuts and headhunters every now and then, and
those are much less related to C++ than Boost's ASIO...

V
 
C

coal

My memory might be as senile as yours, it recollects sth. like
"... standard C++ and freely available platform independent
libraries (such as boost and loki)..."

I've shared my views on Boost on this newsgroup quite a bit.
Basically I think you should "chew the meat and spit the
bones." In other words, the utility/quality of the libs
varies.

Recently I've expanded the page that compares the freely
available and platform independent C++ Middleware Writer
with the Boost Serialization library --
http://webEbenezer.net/comparison.html.
I have some ideas for topics to add to the page, but would
like to get feedback on what's already there.


Brian Wood
Ebenezer Enterprises
www.webEbenezer.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top