Re: Inter-processor atomic operationss
- From: "Vladimir Scherbina" <vladimir.scherbina@xxxxxxxxxxxx>
- Date: Thu, 16 Mar 2006 17:03:36 +0200
Are you talking about RTL_CRITICAL_SECTION::LockSemaphore ? If yes, then
sure, this trick can be used...but I don't suggest undocumented way to OP :)
--
Vladimir
http://spaces.msn.com/vladimir-scherbina/
"Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eg$eiXQSGHA.1728@xxxxxxxxxxxxxxxxxxxxxxx
This isn't really why. If you put a critical section in a region of
shared memory, made sure the wait semaphore was created and duplicated to
both processes, then it would work.
(Of course, critical sections are not designed to do this - no documented
APIs to get at the wait semaphore. But it would work if you forced the
semaphore to be created early and then could safely get the handle to
duplicate it into the other process.)
"Vladimir Scherbina" <vladimir.scherbina@xxxxxxxxxxxx> wrote in message
news:OI5NERQSGHA.5552@xxxxxxxxxxxxxxxxxxxxxxx
To OP: in addition to Slava's post, critical sections cannot be used for
interprocess communications, because they're user mode objcts.
--
Vladimir
http://spaces.msn.com/vladimir-scherbina/
"Slava M. Usov" <stripit.slough@xxxxxxx> wrote in message
news:Op%23MmXPSGHA.4608@xxxxxxxxxxxxxxxxxxxxxxx
"Nadav" <Nadav@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:236CA1CA-2509-4344-8691-4E31F30B3529@xxxxxxxxxxxxxxxx
Hi,
I am developing a server that should work on a multiple CPU machine,
some
questions:
1. Does the Interlocked API set guarantee inter CPU atomic operations
or
JUST inter thread atomic operations.
How can you ensure thread atomic operations without ensuring CPU atomic
operations?
2. The 'volatile' keyword assures that the volatile variable would use
a
register for interaction
Not even close. The volatile keyword ensures that access to a variable
will
not be optimized away by the compiler.
[...]
Is there any solution other then using the common sync objects (
critical
sec, mutex, . ) for inter-process atomic operations?
State the problem if you're looking for a solution.
S
.
- Follow-Ups:
- Re: Inter-processor atomic operationss
- From: Skywing
- Re: Inter-processor atomic operationss
- References:
- Re: Inter-processor atomic operationss
- From: Slava M. Usov
- Re: Inter-processor atomic operationss
- From: Vladimir Scherbina
- Re: Inter-processor atomic operationss
- From: Skywing
- Re: Inter-processor atomic operationss
- Prev by Date: Re: Inter-processor atomic operationss
- Next by Date: Re: Inter-processor atomic operationss
- Previous by thread: Re: Inter-processor atomic operationss
- Next by thread: Re: Inter-processor atomic operationss
- Index(es):
Relevant Pages
|