Re: Inter-process atomic operations



Comments inline:
"Nadav" <Nadav@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1B840805-16A8-4D62-B3E1-BDBF31DE68C6@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.

The interlocked operations are atomic across CPU's

2. The 'volatile' keyword assures that the volatile variable would use a
register for interaction, this guarantee atomic interactions, BUT, when
dealing with several CPUs we have multiple sets of registers, would
setting a
variable as volatile guarantee inter-process atomic interactions?

volatile ensures things do not go into registers! volatile is by itself not
enough to
ensure correct operation.

Is there any solution other then using the common sync objects ( critical
sec, mutex, . ) for inter-process atomic operations?

Use Interlocked api's where possible.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply



.



Relevant Pages

  • Re: [RFC] CPU controllers?
    ... good candidates for a minimal controller to begin with. ... Timeslice scaling ... Provide guaranteed CPU execution rate on a per-task-group basis ... Guarantee provided over an interval of 5 seconds. ...
    (Linux-Kernel)
  • Re: [PATCH 10/10] atomic.h : Add atomic64 cmpxchg, xchg and add_unless to x86_64
    ... Atomic operations that C can't guarantee us. ... typedef struct {volatile int counter;} atomic_t; ...
    (Linux-Kernel)
  • [RFC] CPU controllers?
    ... consensus seems to have been reached on what an acceptable CPU controller ... CPU rate-cap ... Should it support limit and guarantee both? ... Limit CPU execution rate on a per-task basis. ...
    (Linux-Kernel)
  • Re: working with addresses
    ... Yes but it is not a trivial operation to switch addressing modes. ... > being the most common desktop 32-bit CPU these days). ... everything that is documented in the standards, ... I know what guarantee means I have a dictionary here you know :-) ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [RFC] MMIO accessors & barriers documentation
    ... Of course there is no guarantee of ordering of the stores from ... Yes, they do, and what happen if those register "files" happen to be ... consecutive in the address space and the CPU suddenly combines a store ... Au contraire -- if you're proposing to hugely invasively change some ...
    (Linux-Kernel)