Boost logo

Boost :

Subject: Re: [boost] Asynchronous library now in Boost Library Incubator
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2016-11-29 07:18:49


Hi Vicente,

>> In theory, the standard version would suffice, except for Thread.
>> Boost.Thread provides interruption points, which the standard does not.
>> With the standard version, I would not be able to offer task
interruption.
>Could you explain why task interruption is associated to thread
>interruption?

Ah already implementation details :)

Tasks are executed in schedulers (uisually threadpools), which manage 1 to
n threads. To interrupt a task from outside, the library interrupts the
thread running the task. To be exact, the task will be interrupted the next
interruption point in encounters. The thread executing the task does not
terminate but instead recovers and pops the next task from its job queue.

>> I rely for the other parts also on Boost because the standard version
had
>> bugs on earlier versions of compilers, and quite some projects are still
>> stuck with gcc-4.9 or mingw. At some points, it seemed easier to
maintain
>> using Boost (which also happens to be faster than the standard, at least
on
>> my tests).
>>
>Whow, glad to hear Boost.Thread is working for you Henry.

It is. I got no problem whatsoever.

>I believe that Michael is however right. Boost libraries restricted to
>C++11 should use the standard library as much as possible.

Sure. At the moment I have no way around Boost.Thread though. If that
changes, I'll probably want to switch to standard. The performance issue
for the clock is not a huge one and by that time, the older compilers will
hopefully have vanished.

I could provide a macro to switch between boost / std. If one needn't
interrupt tasks, the library would make no use of boost at all.

>It would be great to have a specific C++11 (language and standard
>library) version of your library.

Well, if there is interest, why not?

>Good luck with the review,

>Vicente

>P.S. I've in my todo's list implement thread interruption on top of the
>standard as Anthony showed in his book, but I have no time to work on
>this now.

Oh, it would be great. This really is a fantastic feature.

Thanks,

Christophe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk