This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: cpuset_t interfaces


Ulrich Drepper <drepper@redhat.com> writes:

> I intend to change the interfaces taking a cpuset_t parameter.
> Currently we have
>
> extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
>                                         __const cpu_set_t *__cpuset);
> extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
>                                         cpu_set_t *__cpuset);
>
> and the sched_[sg]etaffinity interfaces which have no prototype yet.
>
> The problem is the limited cpuset_t size.  Just thinking about HT
> multicore processors in multi-processor machines should be enough that
> 1024 virtual processors isn't that hard to reach.
>
>
> Therefore the interface should include a size parameter:
>
> extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
>                                         __const cpu_set_t *__cpuset,
>                                         size_t size);
> extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
>                                         cpu_set_t *__cpuset,
>                                         size_t size);
>
>
> This way the data structure can be expanded if necessary.
>
> The interfaces are in very little use today.  We keep the old interfaces
> and make them simple wrappers with a fixed size of 128 bytes.
>
>
> Unless I hear well-founded objections I'll make the change tomorrow.

Go ahead and make the change.  Since you leave the compatibilty
interface, it should be ok...

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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