what do u mean by Semaphore..when v wil go for using
this..explain about hat.what is the difference
betw..binary ,,counting and mutex semphores

Answers were Sorted based on User's Feedback



what do u mean by Semaphore..when v wil go for using this..explain about hat.what is the differenc..

Answer / preeti.j

Semaphore is a mechanism is an RTOS to serialize access to
a resource/resources for all the threads in the system.
There are 2 types of semaphore
1. counting semaphore - this is used when a set of
resources have to be shared between many threads. The
semaphore is initialized with the number of resources. Each
time a thread tries to access the semaphore, its value gets
decremented until it becomes 0. After this any try to
access the semaphore will block the calling thread.
2. binary semaphore - this is used to serialize access to a
single resource i.e the semaphore has only two values 0 and
1.
A mutex is similar to a binary semaphore except that it has
an owner i.e the thread where it was created. A mutex can
be freed only by this thread. This is not the case for
binary semaphore which can be freed by any thread.

Is This Answer Correct ?    37 Yes 6 No

what do u mean by Semaphore..when v wil go for using this..explain about hat.what is the differenc..

Answer / vijay patil

semaphore is used to avoid the effect of dead lock.
there are three types of semaphore .
1)binary semaphore->it is only to acquire and release the
semaphore.zero is used for unavailabel and
one is used for available.
2)counting semaphore->when semaphore is acquired counter is
incremented and when semaphore is released conter is
decremented.when counter is zero it is goes to blocked state.
3)mutual exclusion->it is same as binary semaphore.but it is
used for safty purpose.it is two state locked state and
unlocked state.when semaphore is acquired it is goes to
locked state and when semaphore is released it goes to
unlocked state.

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Vxworks Interview Questions

What is priority inversion?

10 Answers   Juniper Networks,


IN RTOS HAVING 1OKBYTES OF MEMORY AND YOUR PROGRAMM FOR ASKING FOR 5KBYTES AND YOU GOT NULL ERROR ? WHY DOES IT BEHAVES LIKE THIS

4 Answers  


hi this is srikanth i need video classes for Vxworks any body having this forward me thanking u

1 Answers   DELL, Wipro,


What is another for creating a task without using taskspawn?

2 Answers  


I have a situation where the programme counter(PC) shows that vxworks msgQreceive function has been called by task A and Q is full, still I am not picking up the messages. There is no other task registered to receive messages from this Q. The sending task B, which is ISR in this case, is getting timedout everytime it tries posting new message in it. A's state is PEND which means I am waiting for some resource to get free but PC shows I have called vxworks msgQReceive and currently at qJobget+0x018 location. There seems to be two causes now(identified by me): either vxworks qjobget task is not able to do semTake or no messages in Q. But Q is full and semTake failure seems unlikely(though I dont have a mechanism to check so). Besides explaining root cause for above, can anyone suggest how to get my task in READY state again? I also tried flushing the Q; on doing this, more messages get posted in Q but A still doesnt pick up any :(

4 Answers  






Which RTOS supports Non-Preemptive scheduling ? Why other scheduling methods are supported by such Oses?

1 Answers   Elico,


what do u mean by Semaphore..when v wil go for using this..explain about hat.what is the difference betw..binary ,,counting and mutex semphores

2 Answers   Bosch,


what are the various methods to overcome it?

2 Answers   Vector India,


Assume there is a global variable & a static global variable.Both gets memory allocated from the data segment. Then how does the visiblity of static global varible gets limited to the file alone (in which it gets declared) ???

2 Answers   Wipro,


Write a code to connect Hardware interrupt to ISR...?

1 Answers   iNet, Wipro,


what is task spawn in vxworks ?plz anyone explain me

2 Answers   NAL,


Categories