Re: Inter-processor atomic operationss

Tech-Archive recommends: Fix windows errors by optimizing your registry



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








.



Relevant Pages

  • Re: Inter-processor atomic operationss
    ... APIs to get at the wait semaphore. ... duplicate it into the other process.) ... JUST inter thread atomic operations. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Inter-processor atomic operationss
    ... APIs to get at the wait semaphore. ... Does the Interlocked API set guarantee inter CPU atomic operations ... JUST inter thread atomic operations. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Inter-processor atomic operationss
    ... possible to design a synchronization mechanism that works in user mode cross ... APIs to get at the wait semaphore. ... Does the Interlocked API set guarantee inter CPU atomic operations ... JUST inter thread atomic operations. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Inter-processor atomic operationss
    ... make synchronization objects that operate in user mode cross-process. ... APIs to get at the wait semaphore. ... Does the Interlocked API set guarantee inter CPU atomic operations ... JUST inter thread atomic operations. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Inter-processor atomic operationss
    ... Putting it to a shared memory is very bad idea. ... APIs to get at the wait semaphore. ... Does the Interlocked API set guarantee inter CPU atomic operations ... JUST inter thread atomic operations. ...
    (microsoft.public.win32.programmer.kernel)