
Hi, because some of the community members have had some problems to access the archive I've uploaded the library to a new location. docu: http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/ src: http://ok73.ok.funpic.de/boost.coroutine.zip I'd like to remember that the review starts at September 3, 2012. The library contains one example using boost.asio together with a stream reading from a socket (without blocking the application if newline was not received). regards, Oliver

2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip<http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-(

On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote:
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip<http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-(
Your links look rather strange. Are your troubles related to your mail agent messing them up, or is the host unreachable even if you take care to copy out the exact unbroken URL? -- Lars Viklund | zao@acc.umu.se

2012/8/12 Lars Viklund <zao@acc.umu.se>
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access
On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote: the
archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/< http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip< http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-(
Your links look rather strange. Are your troubles related to your mail agent messing them up,
No.
or is the host unreachable even if you take care to copy out the exact unbroken URL?
Yep :-/

TONGARI <tongari95@gmail.com> writes:
2012/8/12 Lars Viklund <zao@acc.umu.se>
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access
On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote: the
archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/< http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip< http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-(
I've mirrored it at: http://www.doc.ic.ac.uk/~awl03/coroutine/boost/libs/coroutine/doc/html/ and http://www.doc.ic.ac.uk/~awl03/coroutine/boost.coroutine.zip HTH Alex -- Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

Am 11.08.2012 22:37, schrieb Lars Viklund:
On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote:
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip<http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-( Your links look rather strange. Are your troubles related to your mail agent messing them up, or is the host unreachable even if you take care to copy out the exact unbroken URL?
http://ok73.ok.funpic.de/boost.coroutine.zip http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/ should work

On Sun, Aug 12, 2012 at 08:38:55AM +0200, Oliver Kowalke wrote:
Am 11.08.2012 22:37, schrieb Lars Viklund:
On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote:
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip<http://ok73.ok.funpic.de/boost.coroutine.zip>
Still cannot access :-( Your links look rather strange. Are your troubles related to your mail agent messing them up, or is the host unreachable even if you take care to copy out the exact unbroken URL?
http://ok73.ok.funpic.de/boost.coroutine.zip http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/
should work
It clearly doesn't for Mr. TONGARI, considering it's the same links. I'm suspecting that he has trouble with some trigger-happy malware filtering, corporate firewall or ISP censorship. It'd help if he actually said what doesn't work. -- Lars Viklund | zao@acc.umu.se

Am 12.08.2012 11:08, schrieb Lars Viklund:
On Sun, Aug 12, 2012 at 08:38:55AM +0200, Oliver Kowalke wrote:
Am 11.08.2012 22:37, schrieb Lars Viklund:
On Sun, Aug 12, 2012 at 04:16:43AM +0800, TONGARI wrote:
2012/8/12 Oliver Kowalke <oliver.kowalke@gmx.de>
Hi,
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> src: http://ok73.ok.funpic.de/**boost.coroutine.zip<http://ok73.ok.funpic.de/boost.coroutine.zip> Still cannot access :-( Your links look rather strange. Are your troubles related to your mail agent messing them up, or is the host unreachable even if you take care to copy out the exact unbroken URL?
http://ok73.ok.funpic.de/boost.coroutine.zip http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/
should work It clearly doesn't for Mr. TONGARI, considering it's the same links. I'm suspecting that he has trouble with some trigger-happy malware filtering, corporate firewall or ISP censorship. It'd help if he actually said what doesn't work.
thunderbird does encode the url if copied&pasted from a web-browser and might dispalyed on some email-clients in the ugly http://ok73.ok.funpic.de/**boost/libs/coroutine/doc/html/<http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/> ... funpic.de should not block requests as bplaced.net does - but you could use proxies like hidemyass.com

Oliver Kowalke wrote:
because some of the community members have had some problems to access the archive I've uploaded the library to a new location.
docu: http://ok73.ok.funpic.de/boost/libs/coroutine/doc/html/ src: http://ok73.ok.funpic.de/boost.coroutine.zip
I confirmed that these links are accessible from East Asia. Regards, Michel

Hi, In an attempt to help I've put the zip on my server hosted in France: http://klaimsden.net/temp/boost.coroutine.zip If it works, I can also host (until it is in official boost doc) the docs but I need a html version (that is not in the zip and I cannot generate from here). Joel Lamotte

Oliver wrote <snip>
I'd like to remember that the review starts at September 3, 2012.
<snip>
regards, Oliver
Thanks for your work with coroutine, Oliver. I am working on my review (which will be positive). I have a simple coding problem that you may be able to resolve for me. The code below is designed to run indefinitely with one coroutine. I have, however, used one integer parameter to the subroutine f(). The integer parameter is, however, not needed. Yet I can not seem to remove the integer parameter and get the sample to compile. Can I remove the integer parameter? If so, how should it be coded? Thank you. Best regards, Chris. ------------------------------------------------------------------------------------ #include <iostream> #include <boost/coroutine/all.hpp> #include <boost/bind.hpp> typedef boost::coro::coroutine< void() > coro_t; void f(coro_t::self_t & self, int) { for(;;) { std::cout << "In coroutine" << std::endl; self.yield(); } } int main(int, char**) { coro_t c( boost::bind(f, _1, 1000) ); for ( ;; ) { std::cout << "In main" << std::endl; c(); } }

Hi, Am 05.09.2012 21:50, schrieb Christopher Kormanyos:
The code below is designed to run indefinitely with one coroutine. I have, however, used one integer parameter to the subroutine f(). The integer parameter is, however, not needed. Yet I can not seem to remove the integer parameter and get the sample to compile.
Can I remove the integer parameter? yes If so, how should it be coded? This version compiles for me:
#include <iostream> #include <boost/coroutine/all.hpp> #include <boost/bind.hpp> typedef boost::coro::coroutine< void() > coro_t; void f(coro_t::self_t & self) // 2nd. arg of type int removed { for(;;) { std::cout << "In coroutine" << std::endl; self.yield(); } } int main(int, char**) { coro_t c( boost::bind(f, _1) ); for ( ;; ) { std::cout << "In main" << std::endl; c(); } } but this second version (binding the 2nd parameter) works for me too: #include <iostream> #include <boost/coroutine/all.hpp> #include <boost/bind.hpp> typedef boost::coro::coroutine< void() > coro_t; void f(coro_t::self_t & self, int i) { for(;;) { std::cout << "In coroutine, i == " << i << std::endl; self.yield(); } } int main(int, char**) { coro_t c( boost::bind(f, _1, 1000) ); for ( ;; ) { std::cout << "In main" << std::endl; c(); } } hope I could help regards, Oliver

Can I remove the integer parameter?
yes
If so, how should it be coded? This version compiles for me:
<snip> Thank you Oliver. Your first code suggestion is exactly what I need. It works on the PC with VS2010. In fact, it's running right now indefinitely with two coro's. So now we move on to the hard part. I only have a day or two to try something a little bit harder. Maybe we can do it in the short time, but maybe we need to postpone it. Anyway, let's try. These are really hard questions, I know. So if you can't answer them, please do not worry. We can always look into this later. I would like to deeply embed coroutine in a hard real-time system. For the target system, I will be using use an ARM(R) Cortex(R)-M3 microcontroller *with no* FPU. For this endeavor, I have three questions: 1) How can I set the desired stack size to a small amount such as 256 bytes? 2) I do not want cross-build boost right now. Which asm/cpp files should I extract from context for ARM(R) to include as sources in my project? Please don't worry about me or my sanity here, I roll with cross-compilers and builds all the time! 3) How can I disable saving/restoring of the floating-point context in Boost.Context? My target micro does not have an FPU? Thank you. Sincerely, Chris.

<snip>
I would like to deeply embed coroutine in a hard real-time
system. For the target system, I will be using use an ARM(R) Cortex(R)-M3 microcontroller *with no* FPU.
<snip> Of course, context needs to support ARM(R) Cortex(R)-M3 here, and I recall that it does. Is that correct? <snip> Thanks again. Sincerely, Chris.

Am 05.09.2012 23:01, schrieb Christopher Kormanyos: > 1) How can I set the desired stack size to a small amount > such as 256 bytes? with a stack of 256 bytes I assume you are not interested in a stack with a guard page :) you could simply create your own stack allocator - it needs only satisfy following requirements: - member functions void * allocate( std::size_t) and void deallocate( void *, std::size_t) - most important the pointer returned by allocate() must be the start address of the stack and because ARM uses descending stacks (I know the instruction set supports ascending instructions too) it must be the highest address - simply calloc()/free() should do it > 2) I do not want cross-build boost right now. > Which asm/cpp files should I extract from context > for ARM(R) to include as sources in my project? > Please don't worry about me or my sanity here, > I roll with cross-compilers and builds all the time! - files fcontext.cpp and fcontext_arm_aapcs_elf_gas.S (headers?) > 3) How can I disable saving/restoring of the > floating-point context in Boost.Context? > My target micro does not have an FPU? > If the Cortex-Mx has no FPU so that you do not use the compiler flag --hard-float (or so) to compile your code. The asm preserving the FPU registers is wrapped by: #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) In your case the FPU preserving instructions will not be compiled. For sanity you could explictly disable FPU preserving via the 4th argument of jump_fcontext(). intptr_t jump_fcontext( fcontext_t * ofc, fcontext_t const* nfc, intptr_t vp, bool preserve_fpu = true); regards, Oliver

1) How can I set the desired stack size to a small amount
such as 256 bytes?
with a stack of 256 bytes I assume you are not interested in a stack with a guard page :) you could simply create your own stack allocator - it needs only satisfy following requirements:
- member functions void * allocate( std::size_t) and void deallocate( void *, std::size_t) - most important the pointer returned by allocate() must be the start address of the stack and because ARM uses descending stacks (I know the instruction set supports ascending instructions too) it must be the highest address - simply calloc()/free() should do it
OK. I have a variety of custom allocators in my collections that will work for these simple first prototyping requirements. I have, for example, a custom allocator based on a chunk of re-usable static RAM allocated as a static array that I can size to anything (such as 256 byte) up front.
2) I do not want cross-build boost right now. Which asm/cpp files should I extract from context for ARM(R) to include as sources in my project? Please don't worry about me or my sanity here, I roll with cross-compilers and builds all the time!
- files fcontext.cpp and fcontext_arm_aapcs_elf_gas.S (headers?)
I will split up the build with the asm/cpp files extracted to my project workspace, whereas the Boost.Context headers will simply remain in boost 1.51. It is unconventional, but it should work for prototyping.
3) How can I disable saving/restoring of the floating-point context in Boost.Context? My target micro does not have an FPU?
If the Cortex-Mx has no FPU so that you do not use the compiler flag --hard-float (or so) to compile your code. The asm preserving the FPU registers is wrapped by:
#if (defined(__VFP_FP__) && !defined(__SOFTFP__)) In your case the FPU preserving instructions will not be compiled. For sanity you could explictly disable FPU preserving via the 4th argument of jump_fcontext().
intptr_t jump_fcontext( fcontext_t * ofc, fcontext_t const* nfc, intptr_t vp, bool preserve_fpu = true);
regards, Oliver
OK, excellent! That all makes sense. Microcontrollers are tricky and sometimes you need to use an in-circuit emulator (ICE) when assembly programming is involved. I will give it my best try in the short time I have and see if it works. It sounds more like a multi-day endeavor. But I only have a day or two. I will report back with the results. Thank you. Sincerely, Chris.
participants (7)
-
Alexander Lamaison
-
Christopher Kormanyos
-
Klaim - Joël Lamotte
-
Lars Viklund
-
Michel Morin
-
Oliver Kowalke
-
TONGARI