From: Mark Hobley on
I am writing code that utilizes mutexes and rwlocks. I know that I can
define a mutex or an rwlock with a default value by providing a value of NULL
to the appropriate initialization functions:

pthread_mutex_init(mymutex,NULL);
pthread_rwlock_init(myrwlock,NULL);

However, the documentation that I have found so far seems to be vague about
what attributes are and what values are available.

What are these attributes? I know (or I think I know) that the mutex and
rwlock mechanisms utilize these attributes during operation.

What values other than NULL could I have provided? Is the intent of these
functions to allow users to specify their own attribute properties or are
attributes just set to either NULL, or copied from other mutexes and rwlocks?

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/

From: Mark Hobley on
In comp.unix.programmer Ersek, Laszlo <lacos(a)caesar.elte.hu> wrote:

> Umm, press Ctrl-G in Firefox a few times, and when you hit clickable links
> in the SEE ALSO section, leverage the middle button (or Shift-F10 + "t")
> repeatedly to facilitate a breadth-first traversal of individual attribute
> specifications. Is that too much work?

Well. I did that. I found some notes on a thing called "type attributes", but
I notice that these are of type int, whereas the attributes that I am talking
about are of types pthread_mutexattr_t and pthread_rwattr_t, so I am currently
confused. Are these talking about the same things? What the document talks
about a "type attribute", does it mean an "attribute"? If so, why is there
a difference in the typecast?

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/

From: Mark Hobley on
In comp.unix.programmer Ian Collins <ian-news(a)hotmail.com> wrote:

> So you have to go to your implementation's documentation to find the
> default values. Try man pthread_attr_init.

Right. That man page does not appear on my system (based on Debian). I'll find
out which package that is hidden in, and try and get the missing page
installed.

Cheers,

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/

From: Bill Cunningham on
Mark Hobley wrote:
> I am writing code that utilizes mutexes and rwlocks. I know that I can
> define a mutex or an rwlock with a default value by providing a value
> of NULL to the appropriate initialization functions:
[snip]

There is comp.programing.threads

Bill


From: Rainer Weikusat on
markhobley(a)hotpop.donottypethisbit.com (Mark Hobley) writes:
> In comp.unix.programmer Ian Collins <ian-news(a)hotmail.com> wrote:
>> So you have to go to your implementation's documentation to find the
>> default values. Try man pthread_attr_init.
>
> Right. That man page does not appear on my system (based on Debian). I'll find
> out which package that is hidden in, and try and get the missing page
> installed.

It might be a better idea to have a look at the glibc
documentation. The GNU-project doesn't use the tradtional UNIX(*) text
formatting engine to create documentation but a set of TeX-macros
('texinfo') which can be used to either create hypertext-documents
suitable for online reading (this was invented way before the WWW) or
printed books. You can access the manual with the command

info libc

(if you have the glibc-doc-reference [non-free] package installed).

NB: At least by default, this program uses Emacs-keybindings and not
vi-keybindings and the search-function is invoked by 's' and not '/'.

Thread attributes are described in section 34.2.
 |  Next  |  Last
Pages: 1 2 3
Prev: book
Next: Does "df" modify the ext2 filesystem