Questions tagged [mutual-exclusion]

Mutual exclusion means that processes must always execute critical sections in time intervals that do not overlap. The mutual exclusion requirement is one of the most basic in an operating system; without it the OS cannot share resources safely.

261 questions
-1
votes
2 answers

Peterson's algorithm: Can deadlock occur

if in peterson's algo, A process is preempted just after comming out of critical region before setting its flag to false. Then will not be there a deadlock. ?? plz help !
Abhishek
  • 9
  • 1
  • 1
-1
votes
1 answer

How do you delete or edit a file in PHP when it is being read?

Supposing that there is a file on PHP. The file is constantly being read. I want to stop users from accessing the file first, then delete or edit the file. How can I do this?
Long Le
  • 404
  • 5
  • 18
-1
votes
2 answers

Can I bypass ERROR_SHARING_VIOLATION?

I have the following C# code: static void Main(string[] args) { FileStream fileStream = null; try { // read from file or write to file fileStream = new FileStream(@"D:\FileLock.txt", FileMode.Open,…
conectionist
  • 2,694
  • 6
  • 28
  • 50
-1
votes
1 answer

Understanding critical region

I was reading through some examples online regarding about the critical region, entry protocol and exit protocol, and had a hard time figuring out. http://pages.cs.wisc.edu/~dusseau/Classes/CS537-S01/SampleQuizzes/sol2.html class BankAccount { …
i-link
  • 75
  • 1
  • 5
-1
votes
1 answer

How do clients on wireless networks decide who can transmit at any given time?

I've been thinking about wireless networking a little bit recently, and I came upon a realization last night that I can't find an answer to: how do clients know when they can transmit and not stomp over another clients' transmission? I assume there…
kestrel
  • 1,314
  • 10
  • 31
-2
votes
1 answer

Calling release before acquire by a thread

I am writing a small program of multiple threads and I am using Semaphore to enforce mutual exclusion.But a problem triggers to my head. What happens if Semaphore.release is called before Semaphore.acquire ? mine works fine. is it a bad practice or…
user2714949
  • 399
  • 2
  • 3
  • 11
1 2 3
17
18