This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Patch - Add pthread affinity for RTEMS
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: Gedare Bloom <gedare at rtems dot org>
- Cc: "newlib at sourceware dot org" <newlib at sourceware dot org>, Chris Johns <chrisj at rtems dot org>, "Sebastian dot Huber at embedded-brains dot de" <Sebastian dot Huber at embedded-brains dot de>
- Date: Fri, 22 Nov 2013 13:14:22 -0600
- Subject: Re: Patch - Add pthread affinity for RTEMS
- Authentication-results: sourceware.org; auth=none
- References: <528F6A68 dot 1070607 at oarcorp dot com> <CAC82fA3ANq_0EE=hZyJCf0h-02=RHsEvZ9aYbLhU42Rfbt0RoA at mail dot gmail dot com>
On 11/22/2013 8:42 AM, Gedare Bloom wrote:
> Joel,
> I have two quite minor comments.
> 1) Add a space after the comma in newlib/libc/include/pthread.h
> + (pthread_attr_t *__attr,size_t __cpusetsize,
Got it. Thanks.
> 2) In types.h, why relocate the guardsize definition and not just put
> the affinity either with guardsize at its current location, or add a
> new ifdef block for affinity? Presumably if another project cares to
> use the pthread_setaffinity, they could update the ifdef for affinity
> and not pull in guardsize. I'm not certain if it matters much.
Since they were both guarded by __rtems__ and we are built from
source (no binary compatibility concerns), we thought it was cleaner
to have one ifdef block.
We can undo this but it seems better to have OS specific stuff at
the bottom of fields protected by feature flags.
So not changing unless someone can make a stronger argument. :)
--joel
> -Gedare
>
>
>
> On Fri, Nov 22, 2013 at 9:30 AM, Joel Sherrill
> <joel.sherrill@oarcorp.com> wrote:
>> Hi
>>
>> This patch follows up on the recent addition of the
>> RTEMS specific cpuset.h and adds GNU/Linux style
>> pthread affinity APIs to pthread.h.
>>
>> Sebastian.. we think the guards follow your recommendations.
>>
>> OK to commit?
>>
>> 2013-11-22 Jennifer Averett <jennifer.averett@oarcorp.com>
>>
>> * libc/include/pthread.h (pthread_attr_setaffinity_np,
>> pthread_attr_getaffinity_np, pthread_setaffinity_np,
>> pthread_getaffinity_np, pthread_getattr_np): Add pthread obtain
>> attribute and SMP affinity methods to RTEMS for compatibility
>> with GNU/Linux.
>> * libc/include/sys/types.h: Add cpuset to pthread_attr_t for RTEMS.
>>
>> --
>> Joel Sherrill, Ph.D. Director of Research & Development
>> joel.sherrill@OARcorp.com On-Line Applications Research
>> Ask me about RTEMS: a free RTOS Huntsville AL 35805
>> Support Available (256) 722-9985
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985