ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Operating Systems >> Operating Systems AllOther
 
 


 

 
 Windows interview questions  Windows Interview Questions (339)
 Linux interview questions  Linux Interview Questions (449)
 Unix interview questions  Unix Interview Questions (455)
 Solaris interview questions  Solaris Interview Questions (781)
 RTOS interview questions  RTOS Interview Questions (43)
 Bulnex interview questions  Bulnex Interview Questions (4)
 Operating Systems General Concepts interview questions  Operating Systems General Concepts Interview Questions (261)
 Data Structures interview questions  Data Structures Interview Questions (66)
 Operating Systems AllOther interview questions  Operating Systems AllOther Interview Questions (47)
Question
What is a semaphore?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is a semaphore?
Answer
# 1
Semaphores r software, blocking, OS assistance solution to
the mutual exclusion problem .It is
basically a non-negative integer variable that saves the
number of wakeup signals sent so they are not lost if the
process is not sleeping

another interpretation is that the semaphore value
represents the number of resources available
 
Is This Answer Correct ?    100 Yes 34 No
Swetcha
[Semanticspace]
 
  Re: What is a semaphore?
Answer
# 2
Semaphore is a machanism to resolve resources conflicts by
tallying resource seekers what is the state of sought
resources, achieving a mutual exclusive access to resources.
Often semaphore operates as a type of mutual exclusive
counters (such as mutexes) where it holds a number of access
keys to the resources. Process that seeks the resources must
obtain one of those access keys, one of semaphores, before
it proceeds further to utilize the resource. If there is no
more such a key available to the process, it has to wait for
the current resource user to release the key.
 
Is This Answer Correct ?    66 Yes 25 No
Kwrtos
 
 
 
  Re: What is a semaphore?
Answer
# 3
A semaphore, a new variable type.
A semaphore could have the value 0,indicating that no
wakeups were saved, or some positive values if one or more
wakeups were pending.
a semaphore s is an integer variable that apart from
initialization, is accesssed only through two standard
atomic operations, wait and signal. these operations were
orignially termed p(for wait to test) and v(for signal to
increment).
The classical defination of wait in psedocode is
wait(s)
{
while(s<=0)
;// no-op
s--;
}
The classical defination of signal in psedocode is
signal(s)
{
s++;
}
Modification to the integer value of smaphore in wait and
signal operations must be executed individually.
that is, when one process modifies the semaphore value no
other process can simultaneously modifiy that same
semaphore value.
 
Is This Answer Correct ?    67 Yes 11 No
Jethva_trupti
[Syntel Ltd]
 
  Re: What is a semaphore?
Answer
# 4
semopore is s\w 
Is This Answer Correct ?    18 Yes 105 No
Sankar
 
  Re: What is a semaphore?
Answer
# 5
In computer science, a semaphore is a protected variable or
abstract data type which constitutes the classic method for
restricting access to shared resources such as shared
memory in a multiprogramming environment. A counting
semaphore is a counter for a set of available resources,
rather than a locked/unlocked flag of a single resource. It
was invented by Edsger Dijkstra. Semaphores are the classic
solution to preventing race conditions in the dining
philosophers problem, although they do not prevent resource
deadlocks.
Semaphores can only be accessed using the following
operations. Those marked atomic should not be interrupted
(that is, if the system decides that the "turn is up" for
the program doing this, it shouldn't stop it in the middle
of those instructions) for the reasons explained below.
P(Semaphore s) // Acquire Resource
{
wait until s > 0, then s := s-1;
/* must be atomic because of race conditions */
}

V(Semaphore s) // Release Resource
{
s := s+1; /* must be atomic */
}

Init(Semaphore s, Integer v)
{
s := v;
}
 
Is This Answer Correct ?    29 Yes 12 No
Sagarika Mishra
 
  Re: What is a semaphore?
Answer
# 6
Synchronization tool that does not require busy waiting
Semaphore S–integer variable
Two standard operations modify S: wait()and signal()
Originally called P()andV()
Less complicated
Can only be accessed via two indivisible (atomic) operations

wait (S)
{
while S <= 0;
// no-op
S--;
}
&#61548;signal (S)
{
S++;
}
 
Is This Answer Correct ?    23 Yes 11 No
Chinnadurai.s
 
  Re: What is a semaphore?
Answer
# 7
Semaphore is a variable which ios used to provide mutual
exclusion. It has two operations namely wait() and signal()
 
Is This Answer Correct ?    15 Yes 14 No
Gaurav
 
  Re: What is a semaphore?
Answer
# 8
The semaphore abstract data type is perhaps the simplest
universally useful implementation of the variables uses as
arguments to the wait and signal operations although there
are many implementations of semaphores, they can be
intuitively thought of as integers, where wait(x) or the
object-orinted x.wait waits until x is greater then zero
and then decrements it, and signal(x)or x.signal increments
x.
 
Is This Answer Correct ?    5 Yes 16 No
Rupam Quila
 
  Re: What is a semaphore?
Answer
# 9
"semaphore " is an integer value that provide signalling
among the process
and it is an synchronization tool
semaphores are proposed by "DIJKSTRA"
generally semaphores are divided into 2 types
they are 1.General semaphore(or)counting semaphore
2.Binary semaphore(or)Mutex
in general semaphores 2 primitives are used they are
1.semwait(s)
2.semsignal(s)
semwait() checks decrements the semaphore value if the value
becomes negative then the process executing the semwait()is
blocked other wise the process continues execution
semsignal() increments the semaphore value if the value is
less than or equal to zero then a process blocked by a
semwait()operation is unblocked
 
Is This Answer Correct ?    18 Yes 9 No
Mahi 27
 
  Re: What is a semaphore?
Answer
# 10
->synchronization tool that does not require busy writing.
->semaphore S-integer variable
->can only be accessesd via two indivisible(atomic) operations
wait(S):while S<=0 do no-op;
S:=s-1;
signal(S):S+1;
semaphores are of two types

COUNTING SEMAPHORE-integer value can range over an
unrestricted domain.

BINARY SEMAPHORE-integer value can range only between 0 and
1;can be simpler to implement.

can implement a counting semaphore S as a binary semaphore.
 
Is This Answer Correct ?    10 Yes 6 No
Kondepati
 

 
 
 
Other Operating Systems AllOther Interview Questions
 
  Question Asked @ Answers
 
What is deadlock? How do you avoid it? Motorola 7
How to Compare Windows OS with OOPs concepts.....?? TCS 3
Method used for Disk searching.. a.linked list b.AVL c.B-tree d. binary tree Hughes 3
One Gigabyte =?( 2 power30 , 2 power 20 ,2 power 10 none) Mascot 4
I have nortan antivirus but some of the virus it can't delete. how will i remove that virus without formating the system ?please help . HCL 3
how does virtual memory work?   1
what is the difference between a soft real time operating system and hard real time operating system? TATA 1
DEFINE YOURSELF AT THE TIME OF INTERVIEW IN TELECOM SECTOR? Airtel 2
What is the difference between multitasking and multiprogramming?   2
If semaphore variable is 8 after 6 wait operations and 3 signal operations.what is semaphore   3
Which of following is used for back-up files? (a) compress (b) Tar (c) make (d) all the above Cadence 1
What is TSY? Samsung 4
 
For more Operating Systems AllOther Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com