semaphore
Waiting on multiple semaphores without busy-waiting (C/C++ Linux)
If I have more than one semaphore, how can I have a process block until at least one of the semaphores is free? I know I can do this with a busy-wait loop such as:[详细]
2023-04-13 01:38 分类:问答Deadlock in Java code with Semaphore and acquire(int)
I have the following Java code: import java.util.concurrent.*; class Foo{ static Semaphore s = new Semaphore(1);[详细]
2023-04-13 01:27 分类:问答C Semaphore Thread read file
I writing code where i have three threads that read lines from a file, and 3 three threads what write to the file. When the lines are read they are stored inside a buffer. when reading 开发者_Python百[详细]
2023-04-12 03:22 分类:问答iPhone: How can I implement semaphore?
Can somebody explain how I can implement semaphore in Objective-C? I did a lot of google search开发者_开发问答ing on the topic, but I haven\'t found anything understandable.If you definitely need an a[详细]
2023-04-10 20:04 分类:问答Semaphores in operating system
Well, what exactly changes the context of processes. Say i have a algo, in which say S=0开发者_如何转开发;[详细]
2023-04-09 07:35 分类:问答Process Synchronisation using semaphores
Here is the problem. I want two processes to occur alternatively, the complete problem is here. Q. In a system ther are two processes named A and B.When the system starts,the process A executes twice[详细]
2023-04-09 03:48 分类:问答How and why can a Semaphore give out more permits than it was initialized with?
I am reading the book Java Concurrency in Practice. In a section about java.util.concurrent.Semaphore, the below lines are present in the book. It is a comment about its implementation of \"virtual pe[详细]
2023-04-07 21:31 分类:问答How to implement event listening in PHP
here is my problem:I have a script (let\'s call it comet.php) whic is requsted by an AJAX client script and wait for a change to happen like this:[详细]
2023-04-06 08:09 分类:问答How to initialise a binary semaphore in C
In the man page it appears that even if you initialise a semaphore to a value of one: sem_init(&mySem, 0, 1);[详细]
2023-04-06 04:38 分类:问答Producer/consumer with bounded buffer
Could someone check my code and tell me if I am on the right track.. It seems like I am a bit lost.. if you see my errors, please let me know them..[详细]
2023-04-05 07:10 分类:问答