Jump to content

Semaphores

- - - - -

  • Please log in to reply
4 replies to this topic

#1
MadFrenchie

MadFrenchie

    Newbie

  • Members
  • Pip
  • 3 posts
Hi everyone,

Have a couple of questions here regarding the semaphores:

The semaphore invariant is often given as nW < nS + init.
How could we explain each term in this invariant? and How is the invariant enforced within the semaphore object?

And I'd like to know why might a semaphore be initialised to values: (a) 0, (b) 1, © N, where n > 1.


Any help would be grandly appreciated.
Thanks a bunch.

#2
MadFrenchie

MadFrenchie

    Newbie

  • Members
  • Pip
  • 3 posts
Bump.

Sorry to bump here but seriously need help here because of a major exam comming up quite soon !
Thanks a lot for any help

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
You've given us no idea what the context of your question is. There are semaphores in data exchanges between systems, semaphores in threading, etc. Also, certain languages have the concept of semaphores as special meanings.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
MadFrenchie

MadFrenchie

    Newbie

  • Members
  • Pip
  • 3 posts
Sorry.
Meant Semaphores in Threading / Processes management.

Thanks for any further answer !

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Unfortunately, the discussion of semaphores may not be as standardized as you'd like to think. nW and nS don't have an inherent meaning. Doing a quick search, I found discussions of semaphores that refer to nP and nV, for example.

Always start with definitions. Also, think about the purpose of initializing a semaphore in the first place.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users