Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

multithreaded timer?

0 views
Skip to first unread message

boost_newbie

unread,
Mar 25, 2009, 10:17:10 AM3/25/09
to
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

Victor Bazarov

unread,
Mar 25, 2009, 10:37:57 AM3/25/09
to
boost_newbie wrote:
> 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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

boost_newbie

unread,
Mar 25, 2009, 11:13:29 AM3/25/09
to


Thankyou for your answer and sorry for cross posting.

Francisco

Yannick Tremblay

unread,
Mar 27, 2009, 8:33:20 AM3/27/09
to
In article <gqdfk5$bec$1...@news.datemas.de>,

Victor Bazarov <v.Aba...@comAcast.net> wrote:
>boost_newbie wrote:
>> 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.

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


Arne Mertz

unread,
Mar 27, 2009, 8:47:18 AM3/27/09
to
On 27 Mrz., 13:33, ytrem...@nyx.nyx.net (Yannick Tremblay) wrote:
> 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


Victor Bazarov

unread,
Mar 27, 2009, 9:28:22 AM3/27/09
to

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...

co...@mailvault.com

unread,
Mar 27, 2009, 12:31:12 PM3/27/09
to

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

0 new messages