← Back to team overview

kicad-developers team mailing list archive

Re: Some first impressions on our tool framework



On 5/6/19 10:48 AM, Jeff Young wrote:
> 1) I hate the coroutines.  They truncate backtraces in the debugger.

I'm not a big fan either but apparently they were the best solution for
the P&S router design.  I don't know if that is still the case or if we
even tried a different solution at the time.   Given the maintenance
issues over the years with the coroutines context switching code, I
would be willing to bet that an equally robust solution that didn't
involve coroutines would not be frowned upon.  I'm sure Tom is getting
tired of fixing the context switching code.  Wait until someone files a
bug report that the RiscV chip context switching code has to be added to
support that platform across multiple compilers. ;)

> 2) Having individual event loops for drawing, moving, etc. hugely improves encapsulation.

This has always been my preferred solution assuming we can pull it off
with out any degradation of the P&S router performance.  It always
seemed to me that dovetailing event handlers in the event handler stack
would be a simple way to provide tool specific behavior without having
to fall back to coroutines or threads but I never tried it so I cannot
say for sure if this is possible or not.

> 3) The improved encapsulation does make debugging easier overall.  It’s still a pity about (1) though.>
> 4) It can be a bit hard to remember all the moving pieces required.  (Hotkey translation, action definition, transistion, etc.)

I think this is true with event driven designs in general.  Although
coroutines add another layer of complexity on top of that.  You can just
as easily create the same issue by yielding in the middle of an event
handler.  I don't claim to be an authority on all of this but I know the
issues that we have had to deal with.  I don't want to spend time on
this during v6 development but it's something we could take a look at
during v7.


> Cheers,
> Jeff.
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp