4

I'm reading a tutorial about "mutex" and "semaphore", in which the following sentence has confused me:

Mutexes can be applied only to threads in a single process and do not work between processes as do semaphores.

Does it mean mutex and semaphore fall into the same category or belong to just the opposite categories? Also, is it a bad wording problem of the author or a poor understanding of mine on the sentence?

5

It might help to clarify if you break the sentence into its two pieces:

Mutexes can be applied only to threads in a single process.

Mutexes do not work between processes as do semaphores.

A slightly better way to word it would be:

Mutexes do not work between processes as semaphores do.

Or even better:

Unlike semaphores, mutexes do not work between processes.

  • 1
    +1 for proposing an alternative sentence structure using "unlike", to get round the semantic and grammatical confusion of the original. – FumbleFingers Oct 31 '11 at 22:16
5

The sentence may be rewritten to:

Mutexes can be applied only to threads in a single process and unlike semaphores they do not work between processes.

This should remove your confusion, I believe. The sentence means that semaphores do work between processes, but mutexes don't.

I don't think the wording is strange. I'd say it's pretty common to say it like that and the problem was in your understanding. You probably never heard anything similar, so you couldn't figure it out.

  • 2
    I think the wording isn't just "strange" - it's awful! It's not at all good practice to tack a "positive" as do X clause on the end of an already overblown sentence structure where the immediately-preceding clause is the "negative" do not work... Gratuitously and carelessly confusing, IMHO. – FumbleFingers Oct 31 '11 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.