[asio][thread] a new model for boost::asio (coroutine)

I have used the recent boost::asio library in my small project, I found it very difficult to correctly write the asynchronous code. So I tried another approach ---- a Half-Sync/Half-Async, I found it much better. The basic idea is very simple, utilize the coroutines(also called light weight threads, or user level threads) to handle multiple connections simultaneously and collaboratively. This approach has the advantange of simplicity in the Synchronous IO model, as well as the high performance in the Asynchronous IO model. Unfortunately, there isn't any coroutine support in boost::thread, and I had to make my experiment with the fiber support in ms windows. So I suggest coroutine be support. The benefit isn't only confined to boost::asio, in fact, it's an important way to describe algorithm flow, and many dynamic languages, both old and new, are supporting this feature. -------------- lihuiba 2006-07-05

On Wed, Jul 05, 2006 at 08:23:08PM +0800, ?????? wrote:
I have used the recent boost::asio library in my small project, I found it very difficult to correctly write the asynchronous code. So I tried another approach ---- a Half-Sync/Half-Async, I found it much better.
No wonder you found that better/easier. You might want to read the USENIX paper http://www.usenix.org/events/hotos03/tech/vonbehren.html maybe it's related to the problem you're solving. Regards -Gerhard -- Gerhard Wesp ZRH office voice: +41 (0)44 668 1878 ZRH office fax: +41 (0)44 668 1818 For the rest I claim that raw pointers must be abolished.

So, is there any interest in a coroutine library for boost::thread? ------------------ lihuiba 2006-07-07 ------------------------------------------------------------- 发件人:Gerhard Wesp 发送日期:2006-07-05 20:34:16 收件人:boost@lists.boost.org 抄送: 主题:Re: [boost] [asio][thread] a new model for boost::asio (coroutine) On Wed, Jul 05, 2006 at 08:23:08PM +0800, ?????? wrote:
I have used the recent boost::asio library in my small project, I found it very difficult to correctly write the asynchronous code. So I tried another approach ---- a Half-Sync/Half-Async, I found it much better.
No wonder you found that better/easier. You might want to read the USENIX paper http://www.usenix.org/events/hotos03/tech/vonbehren.html maybe it's related to the problem you're solving. Regards -Gerhard -- Gerhard Wesp ZRH office voice: +41 (0)44 668 1878 ZRH office fax: +41 (0)44 668 1818 For the rest I claim that raw pointers must be abolished. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

??? wrote:
So, is there any interest in a coroutine library for boost::thread?
https://boost-consulting.com:8443/trac/soc/wiki/coroutine -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
participants (3)
-
Gerhard Wesp
-
Rene Rivera
-
李慧霸