← Back to team overview

kicad-developers team mailing list archive

Re: Kicad Tool Framework

 

On 12 August 2013 16:41, Lorenzo Marcantonio <l.marcantonio@xxxxxxxxxxxx>wrote:

> On Mon, Aug 12, 2013 at 10:58:31AM +0200, Tomasz Wlostowski wrote:
> > Thanks :) I didn't want to impose any particular way of writing
> > these FSMs, every programmers has his/her own taste, so he's free to
> > choose between coroutines, state-as-method or simply a switch(state)
> > {}.
>
> Do you know a good way for coroutines in C/C++? i.e. no setjmp/longjmp
> ugliness...
>
> (next step for world domination would be continuations:D)
>
>
I have done co-routines using "ucontext" available on both Linux and (with
a little work) Windows. I saw an article on the CodeProject (
http://www.codeproject.com/Articles/4225/Unix-ucontext_t-Operations-on-Windows-Platforms
)
which resulted in me implementing this. It works rather well.

I only implemented it like that because I had no choice though. I don't
particularly like co-routines.

Best Regards, Brian.

References