Named Mutex in pthreads

Member
Posts: 129
Joined: 2005.02
Post: #1
I'm currently utilizing pthreads, and I really need to use named mutices. I know you can use a namedmutex in pthreads by:

pthread_mutexattr_init();
pthread_mutexattr_settype();
pthread_mutex_init();

I've read that there is a pthread_mutexattr_setname_np() in some implementations. Is there any funcationlity like this with Mac OS X 10.2.8+?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
read /usr/include/pthread.h
Quote this message in a reply
Member
Posts: 129
Joined: 2005.02
Post: #3
I can read that. Obviously I have read the header file, and my REAL question was if there are any work arounds to utilize functionality like this. I thought (in my mind at least) that I implied there IS a pthread_mutexattr_setname_np() function, but not in the Mac OS X 10.2.x version of pthread.h. However, I found this function on the internet, and it is safe to assume that SOME implementations of pthread include this function.

I am asking of a work around for this.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
perhaps if you explained why you want to give your mutexes a name, we might be of more help...
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
It might be mutices, it's definitely not muticies, but I like mutexes best.

You still haven't explained how giving a mutex a name is any use to anyone...
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #6
maaaaark Wrote:This sounds really lame, but if I said how I was using it, it would kinda of defeat the purpose of using it. I hope that makes sense. Either way I found a different way to achieve the same result.
It does sound really lame. And it doesn't make sense either. If my mutex was named maaaark, it seems like it would block a lot Wink
Quote this message in a reply
Member
Posts: 129
Joined: 2005.02
Post: #7
Right when I got to the punchline of that, I looked at you icon and he was laughing at me ;'(
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #8
maaaaark Wrote:Right when I got to the punchline of that, I looked at you icon and he was laughing at me ;'(
Don't worry about the horned skull, it's crazy Wacko
It gathers its energy by scaring fluffy animals and little children Grin
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  pthreads vs carbon threads tachyon 4 3,069 Jul 18, 2005 08:22 PM
Last Post: tachyon