monitors and POSIX

I was going through c.p.threads today (yeah, I had lot of catchup to do on my newsgroup subscription) and find out this interesting message on monitors and POSIX mutex/cond-variables:

D. butenhof on monitors

: this is a very nice article from Dave Butenhof on the POSIX model, synchronization primitives, and how they can relate to monitors. I particularaly liked this sentence:

Basically, think of a monitor as “mutex +
condition variable + shared predicates”, and you’ll have the basic idea.
It implies that the monitor knows something about the data state; while
a mutex and condition variable don’t.

I like the fact that mutex and condition variables do not “know” anything about the variable state, one can easily build his own abstraction (say … monitors ;-)) on top of them.

You’ll find the whole thread here (including arguments between posters…):

About synchronization methods

Advertisements

About this entry