Click here to Skip to main content
16,006,001 members
Home / Discussions / System Admin
   

System Admin

 
GeneralRe: Help: Windows Fails to start Pin
Colin Angus Mackay7-Aug-05 22:39
Colin Angus Mackay7-Aug-05 22:39 
GeneralRe: Help: Windows Fails to start Pin
Andy Brummer8-Aug-05 12:35
sitebuilderAndy Brummer8-Aug-05 12:35 
Questionanyone know Palm OS? Pin
mijan5-Aug-05 15:55
mijan5-Aug-05 15:55 
AnswerRe: anyone know Palm OS? Pin
Garth J Lancaster5-Aug-05 17:20
professionalGarth J Lancaster5-Aug-05 17:20 
AnswerRe: anyone know Palm OS? Pin
Mekong River7-Aug-05 0:03
Mekong River7-Aug-05 0:03 
QuestionMutex and Semaphore? Pin
badal_akr4-Aug-05 23:15
badal_akr4-Aug-05 23:15 
AnswerRe: Mutex and Semaphore? Pin
Marc Soleda5-Aug-05 7:40
Marc Soleda5-Aug-05 7:40 
AnswerRe: Mutex and Semaphore? Pin
rwestgraham7-Aug-05 11:45
rwestgraham7-Aug-05 11:45 
The classical example is to synchronize shared memory access between multiple threads.

A mutex can only be owned by a single thread at a time. Multiple semaphores can be created. In memory access, multiple readers are allowed but only one writer.

The two are used in conjunction. Study the following sequences until you understand how both readers and writers interact to synchronize thread safe memory access.

Before reading shared memory, a thread must execute the following sequence:

1) Acquire the mutex. If the mutex is not available, another thread is writing memory, and the reader must wait for the mutex.

2) After acquiring mutex, the reader knows it is "safe", i.e no other thread is writing to memory.

3) Acquire a semaphore. This is a signal that other threads may check to see if another thread is currently reading memory.

4) Release the mutex so the next reader thread may acquire the mutex just long enough to acquire a semaphore.

5) Read the shared memory.

6) After memory read is complete, release the semaphore, to signal that the thread is no longer reading the memory.

Before writing shared memory, a thread must execute the following sequence:

1) Acquire the mutex. If the mutex is not available, another thread is writing memory, and the second writer must wait for the mutex. Once a writer acquires the mutex, no other threads can access the memory for read or write, because both operations require the mutex, which is now locked by the writer.

2) Wait for all semaphores to be released. Threads that started reading the memory before the writer locked the mutex may not be finished yet. Once all semaphores have been released, the writer knows that no other threads are accessing the memory.

3) Write to the shared memory.

4) Release the mutex. Now other threads may acquire the mutex long enough to also acquire a semaphore, and start reading the memory again. Or another thread may acquire the mutex for a write operation.
AnswerRe: Mutex and Semaphore? Pin
Andy Brummer7-Aug-05 16:39
sitebuilderAndy Brummer7-Aug-05 16:39 
AnswerRe: Mutex and Semaphore? Pin
badal_akr7-Aug-05 21:32
badal_akr7-Aug-05 21:32 
GeneralURGENT: Server disables all network connections Pin
SABhatti4-Aug-05 13:37
SABhatti4-Aug-05 13:37 
GeneralRe: URGENT: Server disables all network connections Pin
code-frog4-Aug-05 17:27
professionalcode-frog4-Aug-05 17:27 
GeneralRe: URGENT: Server disables all network connections Pin
SABhatti5-Aug-05 2:05
SABhatti5-Aug-05 2:05 
GeneralRe: URGENT: Server disables all network connections Pin
code-frog5-Aug-05 5:22
professionalcode-frog5-Aug-05 5:22 
GeneralRe: URGENT: Server disables all network connections Pin
Mekong River7-Aug-05 0:14
Mekong River7-Aug-05 0:14 
GeneralWindows Presentation Space Pin
XenoTech3-Aug-05 18:40
XenoTech3-Aug-05 18:40 
GeneralRe: Windows Presentation Space Pin
Dario Solera5-Aug-05 1:50
Dario Solera5-Aug-05 1:50 
GeneralRe: Windows Presentation Space Pin
XenoTech7-Aug-05 12:56
XenoTech7-Aug-05 12:56 
GeneralRe: Windows Presentation Space Pin
Mekong River7-Aug-05 0:22
Mekong River7-Aug-05 0:22 
GeneralRe: Windows Presentation Space Pin
XenoTech7-Aug-05 12:56
XenoTech7-Aug-05 12:56 
GeneralDriver related query Pin
surbhikhandelwal3-Aug-05 1:27
surbhikhandelwal3-Aug-05 1:27 
GeneralSoftkey Assign Pin
sweep1232-Aug-05 23:07
sweep1232-Aug-05 23:07 
GeneralRe: Softkey Assign Pin
Mekong River2-Aug-05 23:43
Mekong River2-Aug-05 23:43 
GeneralRe: Softkey Assign Pin
sweep1232-Aug-05 23:59
sweep1232-Aug-05 23:59 
GeneralRe: Softkey Assign Pin
[Marc]3-Aug-05 15:37
[Marc]3-Aug-05 15:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.