This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: Posix Thread name


On Thu, 13 May 2004 16:01:14 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

> On Tue, May 04, 2004 at 01:09:57PM +1000, Tony Butt wrote:
> > I had a requirement to be able to explicitly set the name of a posix thread,
> > made some simple changes to posix/current/src/pthread.cxx and
> > posix/current/include/types.h, and can now optionally set the name of a
> > posix thread created using pthread_create.
> > 
> > The name is set by assigning a value to pthread_attr.name before calling
> > pthread_create().
> 
> As far as i can see, there is nothing in the POSIX pthread standard
> like this.

Yes - I don't think there is even a concept of a thread name, so certainly no mechanism to set one.
> 
> Even if there was, i doubt it would be done by directly modifying the
> pthread_attr structure. I would expect the POSIX people to add two new
> functions, pthread_attr_setname() and pthread_attr_getname().

Yes, that would be more in line with the general posix threads approach.

> 
> I think adding arbitry extensions like this to a standardized API is a
> bad idea. So im tempted to not accept this contribution. Feel free to
> try to change my mind.

My intent was to provide a mechanism to set the name before the thread was created,
in the same way that some other attributes are set. I don't know if the contents of 
pthread_attr_t are completely specified, or just the interface functions (my Posix references are 
a bit thin on the ground here). That would be my only grounds for requesting an inclusion (thin as they are)

Thanks for looking at it anyway...

> 
>         Andrew


-- 
----------------------------------

Tony Butt       
CEA Technologies
----------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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