Re: semaphore question
- From: bastian42@xxxxxxxxx (42Bastian Schick)
- Date: Tue, 15 Aug 2006 03:30:39 GMT
On 14 Aug 2006 12:06:45 -0700, "Jack" <junw2000@xxxxxxxxx> wrote:
Below is a simple pseudocode using semaphore:
while(1){
wait(mutex1); //LINE0
open(file_f); //LINE1
write(file_f); //LINE2
signal(mutex1);
}
In short: You can't protect file-accesses with mutexes.
Mutexes are there to protect global data (either process global or
system-wide global shared memory).
But this works only if all processes/threads obey the mutex.
--
42Bastian
Do not email to bastian42@xxxxxxxxx, it's a spam-only account :-)
Use <same-name>@monlynx.de instead !
.
- Follow-Ups:
- Re: semaphore question
- From: Josef Moellers
- Re: semaphore question
- References:
- semaphore question
- From: Jack
- semaphore question
- Prev by Date: Re: HowTo check whether PAE is enabled on IA32?
- Next by Date: Inject a shared library or DLL into a running process in Linux
- Previous by thread: semaphore question
- Next by thread: Re: semaphore question
- Index(es):
Relevant Pages
|