|
From: | Lundberg, Johannes |
Subject: | Re: NSThread setName idea |
Date: | Tue, 22 Apr 2014 15:29:29 +0900 |
Yes.
On 21 Apr 2014, at 05:44, "Lundberg, Johannes" <johannes@brilliantservice.co.jp> wrote:
> Hi
>
> Is each NSThread object backed by a pthread?
That sounds like an excellent idea.
> 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.
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
pthread_name.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |