new libaray Boost.Fiber in vault

Hello, I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows). regards, Oliver

k-oli@gmx.de wrote:
Hello,
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
What does that map to on POSIX / UNIX platforms, such as Linux ? Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin...

Am Freitag, 31. Oktober 2008 23:22:29 schrieb Stefan Seefeld:
k-oli@gmx.de wrote:
Hello,
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
What does that map to on POSIX / UNIX platforms, such as Linux ?
Thanks, Stefan
POSIX calles it context swapping - Windows fibers. The lib works on POSIX and WIndows. Oliver

Am Samstag, 1. November 2008 14:43:53 schrieb Mathias Gaunard:
k-oli@gmx.de wrote:
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
Are you aware that there is already a library in the work that does this, Boost.Coroutine?
Yes but it doesn't compile on my systems. I need a Fiber library for the threadpool library. Coroutines are a form of control flow and fibers are a systems-level construct.

Am Samstag, 1. November 2008 14:43:53 schrieb Mathias Gaunard:
k-oli@gmx.de wrote:
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
Are you aware that there is already a library in the work that does this, Boost.Coroutine?
Yes but it doesn't compile on my systems.
I'm using it in mission critical code and it works just fine.
I need a Fiber library for the threadpool library. Coroutines are a form of control flow and fibers are a systems-level construct.
The Coroutines library is built on top of a context switching/fibers component supporting better/faster context switching than yours (at least on gcc based platforms), currently. Clearly some integration would be really nice, IMHO. Regards Hartmut

Am Samstag, 1. November 2008 19:24:30 schrieb Hartmut Kaiser:
Am Samstag, 1. November 2008 14:43:53 schrieb Mathias Gaunard:
k-oli@gmx.de wrote:
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
Are you aware that there is already a library in the work that does this, Boost.Coroutine?
Yes but it doesn't compile on my systems.
I'm using it in mission critical code and it works just fine.
I tried Linux amd64 - doesn't compile :(
I need a Fiber library for the threadpool library. Coroutines are a form of control flow and fibers are a systems-level construct.
The Coroutines library is built on top of a context switching/fibers component supporting better/faster context switching than yours (at least on gcc based platforms), currently.
Could you please explain why it is faster? I'm using ::makecontext()/::CreateFiber() too.
Clearly some integration would be really nice, IMHO.
Regards Hartmut
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Am Samstag, 1. November 2008 20:15:27 schrieb Mathias Gaunard:
k-oli@gmx.de wrote:
Could you please explain why it is faster? I'm using ::makecontext()/::CreateFiber() too.
It uses assembly for an optimal, userland-only, solution. At least that was planned I believe.
So it is less portable - on LINUX amd64 I get compiler errors (assembler code doesn't compile). What about HP/UX PA-RISC and Itanium etc.?

Am Samstag, 1. November 2008 19:24:30 schrieb Hartmut Kaiser:
Am Samstag, 1. November 2008 14:43:53 schrieb Mathias Gaunard:
k-oli@gmx.de wrote:
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
Are you aware that there is already a library in the work that does this, Boost.Coroutine?
Yes but it doesn't compile on my systems.
I'm using it in mission critical code and it works just fine.
I tried Linux amd64 - doesn't compile :(
Well, the linux amd64 code in the SVN is an early version of the code I wrote. Seems I need to commit my current stuff to SVN. Sorry for not keeping it up to date. Give me some time to sort things out here.
I need a Fiber library for the threadpool library. Coroutines are a form of control flow and fibers are a systems- level construct.
The Coroutines library is built on top of a context switching/fibers component supporting better/faster context switching than yours (at least on gcc based platforms), currently.
Could you please explain why it is faster? I'm using ::makecontext()/::CreateFiber() too.
On windows you can't make it faster than using native fibers, indeed. I tried using assembly here but this opens another can of worms as it interferes with certain (undocumented) assumptions the OS is making. OTOH, on gcc based platforms the Coroutines lib uses small assembly routines for the context switching itself, which is way faster than makecontext because this requires a kernel call. My measurements show the assembly code being approx 10 times faster than using native fibers. I didn't do any measurements comparing the makecontext version, though. Regards Hartmut

----- Original Message ----- From: "Hartmut Kaiser" <hartmut.kaiser@gmail.com> To: <boost@lists.boost.org> Sent: Saturday, November 01, 2008 7:24 PM Subject: Re: [boost] new libaray Boost.Fiber in vault
The Coroutines library is built on top of a context switching/fibers component supporting better/faster context switching than yours (at least on gcc based platforms), currently.
Clearly some integration would be really nice, IMHO.
Hi, AFAIK, Giovanni was working on a version based on continuations. Can some one clarify the differences between fibers and continuations? Thanks, Vicente

----- Original Message ----- From: <k-oli@gmx.de> To: <boost@lists.boost.org> Sent: Friday, October 31, 2008 10:34 PM Subject: [boost] new libaray Boost.Fiber in vault
Hello,
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
What about fiber specific storage? Vicente

Am Sonntag, 2. November 2008 19:51:54 schrieb vicente.botet:
Hello,
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
What about fiber specific storage?
This is specific for the Win32 fiber API - afaik POSIX does not provide fiber specific storage. regards, Oliver

----- Original Message ----- From: <k-oli@gmx.de> To: <boost@lists.boost.org> Sent: Sunday, November 02, 2008 9:01 PM Subject: Re: [boost] new libaray Boost.Fiber in vault
Am Sonntag, 2. November 2008 19:51:54 schrieb vicente.botet:
Hello,
I've added Boost.Fiber to the boost vault. The library implements lightweight threads of execution (context swapping; fibers on Windows).
What about fiber specific storage?
This is specific for the Win32 fiber API - afaik POSIX does not provide fiber specific storage.
Do you mean that this has no sens independently of the platform? IMO if we can implement thread specific storage we can implement fiber specific storage. It is only a matter to storing whatever is needed on the fiber context. You can find a platform independent implementation of TTS on "Thread-Specific Storage -- An Object Behavioral Pattern for Accessing per-Thread State Efficiently." http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf or see the code from a posix pthread_tss functions implementation. Vicente
participants (5)
-
Hartmut Kaiser
-
k-oli@gmx.de
-
Mathias Gaunard
-
Stefan Seefeld
-
vicente.botet