From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: More oddities with multiple processor groups
Date: Fri, 13 Apr 2018 19:17:00 -0000 [thread overview]
Message-ID: <20180413191734.GC27440@calimero.vinschen.de> (raw)
In-Reply-To: <8829ca51-a131-a88b-4b36-00c965af0b2b@SystematicSw.ab.ca>
[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]
On Apr 13 12:29, Brian Inglis wrote:
> On 2018-04-13 08:12, L A Walsh wrote:
> > Achim Gratz wrote:
> >> The problem here is that on Linux you don't need to do anything extra to
> >> use any of the advertised logical processors from a single application,
> >> while on Windows you need to first create a thread and set it's affinity to
> >> a different group than where your process was started in, then assign each
> >> new thread an affinity to one of the available groups. If you don't do
> >> that, all threads will be restricted to the original group.
> > Not exactly true. They are not *restricted* -- it's a *feature* of the
> > Windows scheduler, in that future procs/threads inherit the cpu of the
> > parent. Linux's scheduler is more advanced as well as being replaceable. MS
> > doesn't want you to do that
> >> there might need to be some option to restrict Cygwin to a single processor
> >> group for some applications to work (correctly).
> > There is. Start them all on a single cpu & set the cpu mask. Pretty much
> > the same way you restrict procs on linux -- you can run them with a specific
> > cpu mask, and most programs will keep running w/that mask.
> > Unfortunately, AFAIK, I don't think POSIX specifies a way to set affinities,
> > so I'm not sure how cygwin would do it.
>
> Glibc adds {pthread,sched}_...affinity... functions.
> Linux uses namespaces, control groups (cgroups), cpusets, sysfs/kernfs:
We would only be able to support it partially. Windows doesn't
allow to set thread affinity across CPU groups. There's no simple
function to set process CPU group affinity, only a function to set
process affinity within a single group. And it has a restriction
in that all current threads have to run in the same CPU group.
The API is pretty tricky.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-04-13 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-11 18:05 Achim Gratz
2018-04-13 14:12 ` L A Walsh
2018-04-13 18:29 ` Brian Inglis
2018-04-13 19:17 ` Corinna Vinschen [this message]
2018-04-13 17:22 ` Brian Inglis
2018-04-13 19:55 ` Achim Gratz
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=20180413191734.GC27440@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@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).