Looking for "Monitor" usage examples

Going through Monitor construct, I didn’t completely figured out higher level concept, and looking for example written in rust.

Example for simple monitor, Hoare and Mesa usage on Producer/Consumer, not as pseudo-code, but real program?

I don’t have a usage example to suggest, but I might be able to help your search.

Unlike Mesa and Java, Rust doesn’t make monitors part of the core language. Instead, you can implement a monitor using two library types:

  • Mutex provides the mutual exclusion part, and
  • Condvar provides the signal/wait aspect.

Searching the web with those terms turned up this example, and while it looks like a Rust version of the Wikipedia code you provided, I haven’t read it carefully to see if I’d recommend it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.