monitors in C?

  • Thread starter =?ISO-8859-1?Q?Andreas_R=F8sdal?=
  • Start date
?

=?ISO-8859-1?Q?Andreas_R=F8sdal?=

Hi,

I'm used to enforcing mutual exclusion (with monitors)
in Java. Any pointers as to how to implement this in C on Linux?
ie. I want to protect a shared object from access to more than one thread
at a time.

Andreas R.
 
D

Default User

Andreas said:
Hi,

I'm used to enforcing mutual exclusion (with monitors)
in Java. Any pointers as to how to implement this in C on Linux?
ie. I want to protect a shared object from access to more than one thread
at a time.


There are no facilities for this in ISO Standard C. You need
platform-specific extensions. I would suggest a Linux or perhaps
comp.unix.programmer.



Brian Rodenborn
 
M

Mark McIntyre

Hi,

I'm used to enforcing mutual exclusion (with monitors)
in Java. Any pointers as to how to implement this in C on Linux?
ie. I want to protect a shared object from access to more than one thread
at a time.

Sounds like you want to use mutexes. This is not properly a C question but
a linux one, since C doesn't have native support for threads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top