[libmill] Re: Tried libmill on cygwin = 2 of 6 tests passed.

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: Joseph Stewart <joseph.stewart@xxxxxxxxx>
  • Date: Fri, 22 May 2015 13:17:29 +0200

Yes, there seems to be no viable standard mechanism for switching the contexts now except for setjmp/longjmp. It's a real problem.

libmill uses an ugly hack to create a new context that's pure C that and doesn't use OS at all -- which can be considered good news, I guess.

As for getcontext and setcontext, they can be in theory replaced by hand-written assembly code. There's such code in libtask and it has friendly license, so we may try to use that.

Martin

On 2015-05-22 13:03, Joseph Stewart wrote:

I understand.

For what it's worth, I don't think anyone got libtask working on Windows
either, and while it does mostly work on ARM Linux, I've had issues on ARM
Linux distros that I can't totally understand.

Anyway, libtask "tasks" are layered on the ucontext calls which are perfect
for these purposes, but deprecated with no alternative proposed that I'm
aware of. Windows does have "fibers", but then getting "choose" to work
there might be a hack (as has always been the case with cygwin/socket/etc).

Anyway, I'll keep watching libmill and hope I can contribute.

VBR,
-joe

On Fri, May 22, 2015 at 2:24 AM, Martin Sustrik <sustrik@xxxxxxxxxx> wrote:

Hi,

Thanks for testing it!

Unfortunately, I can't help with Win problem as I own no Windows box.
Whether it works may be dependent on system internals (stack checking,
implementation details or setjmp/longjmp etc.)

One thing that may be helpful is the stacktrace. Just run a test (say
go.c) in debugger and send the stack trace from the crash to the list.

In the long run, it may make sense to take the context-switching code from
libtask (or p2p project) and use it as a backend for libmill instead of
plain old setjmp/longjmp.

Martin


On 2015-05-22 01:54, Joseph Stewart wrote:

I've made no attempt at debugging yet.

Attaching the test-suite.log and console output of configure / make / make
check at console.log.

I'll next give this a try cross-compiling for ARM Linux.

Thanks for libmill, I've been pining for a replacement for Russ Cox'
libtask and this might be the one.

VBR,
-joe





Other related posts: