discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSThread setName idea


From: Richard Frith-Macdonald
Subject: Re: NSThread setName idea
Date: Mon, 21 Apr 2014 06:04:43 +0100

On 21 Apr 2014, at 05:44, "Lundberg, Johannes" 
<johannes@brilliantservice.co.jp> wrote:

> Hi
> 
> Is each NSThread object backed by a pthread?

Yes.

> If so, would it be possible to have NSThread's setName also do
> pthread_set_name_np(..., ...)
> so that "top" etc also would show the thread name?
> 
> I think I will try to do this anyway for my own debugging purposes. If you 
> like I can submit a patch later.

That sounds like an excellent idea.

The  _np suffix in the function name (pthread_set_name_np) suggests that it's a 
non-standard addition to the pthreads API, so the presence/absence of the 
function would need to be tested at configure time in order to make such 
functionality portable to all the systems gnustrep runs on.

I found this article which suggests it should work in some way for linux/bsd 
systems: 
http://stackoverflow.com/questions/2369738/can-i-set-the-name-of-a-thread-in-pthreads-linux
 and also this one for windows 
http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx


reply via email to

[Prev in Thread] Current Thread [Next in Thread]