This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?


> * Used to create a minimally sized structure to track
>   per-logical-CPU data.
>   - As it is implemented _SC_NPROCESSORS_CONF is a minimal
>     value. Fixing it to match your expected semantics e.g
>     making it the number of possible CPUs, is going
>     to make this value potentially much larger.

Hmm.

This doesn't cross my mind. I think this case should use (c) because otherwise
your application may crash when cpu hotplug occur.
Practically, we have no way to know cpu hot adding _synchronously_ and
there is several
race window if you are polling to change ._SC_NPROCESSORS_CONF value.

Actually, in kernel possible cpus structure was mainly created to
effectively represent
per-cpu data.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]