public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: David McFarland <corngood@gmail.com>
To: cygwin-developers@cygwin.com
Subject: Re: Re: Fibers and cygtls
Date: Fri, 04 Sep 2020 23:46:16 -0300	[thread overview]
Message-ID: <vritzh657xfr.fsf@gmail.com> (raw)
In-Reply-To: <20200904195143.GY4127@calimero.vinschen.de>


> Bottom line is, before trying to use Windows fibers, or before letting
> boost use Windows functions on Cygwin (sigh), check what other POSIX or
> BSD systems provide to implement coroutines.  If there's an API, let's
> implement this API in Cygwin and then use that from user space.

boost-context doesn't actually use Windows fibers by default. Its fiber
implementation (fcontext) uses user-provided buffers for fiber stacks.

The jump implementation is in:

https://github.com/boostorg/context/blob/develop/src/asm/jump_x86_64_ms_pe_gas.asm

On Linux I believe uses its own asm implementation without any kernel
interaction:

https://github.com/boostorg/context/blob/develop/src/asm/jump_x86_64_sysv_elf_gas.S

There's also an implementation (ucontext) using makecontext, which may
be the best option. I'll try that next.

The implementations are compared here:

https://www.boost.org/doc/libs/1_74_0/libs/context/doc/html/context/cc/implementations__fcontext_t__ucontext_t_and_winfiber.html

  reply	other threads:[~2020-09-05  2:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 15:13 David McFarland
2020-09-04 19:51 ` Corinna Vinschen
2020-09-05  2:46   ` David McFarland [this message]
2021-12-20 15:01     ` David McFarland
2021-12-22 15:46       ` David McFarland
2020-09-06 14:19 ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vritzh657xfr.fsf@gmail.com \
    --to=corngood@gmail.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).