Re: OS Question





"Alexander Grigoriev" wrote:

An operation that involves memory modification will only start if the
destination is writeable, no matter if it's interlocked or not. An operation
won't be interrupted in between and then resumed.

I'm not sure why you want to modify page protection on the fly. If this is
for debugging, it's OK. If you base your design on this, it won't work
reliably.

"Hugo gleaves@xxxxxxxxxxx>" <hugh<underbar> wrote in message
news:2A136AC4-76AD-4404-B0C1-67E6EC6BC15E@xxxxxxxxxxxxxxxx
Hi
This isnt strictly about a driver issue, but many driver coders may have
insights.

Basically we plan to user some of the Interlock functions (exchange,
exchange compare etc) as the basis for a simple fast lock (not in driver
code
though).

However, we are also placing the integer values in pages that have had
their
access set to Read Only. Currently when code attempts to write to such a
page
we trap the exception, run a few checks and then update the page to have
Write access.

This is all standard stuff, BUT if we locate an integer in such a page AND
try to use an interlock exchnage kind of function on it, it raises an
interesting question.

The interlock operations are defined as being uniterruptible BUT if they
are
in a ReadOnly page the operation WILL be interrupted (by the exception
that
prevents writes to read only pages).

So would it work or not??

Any insights much appreciated.

PS: We are using XP, Vista, Server 2003 and 2008 both 32-bit and 64-bit.



This inst the example I was referring to, I cant find it just now, but here is one they published some years ago:

http://msdn.microsoft.com/en-us/library/ms810627.aspx

I want to stress that this mechanism we use is an option, if the
designer/coder that uses our API doesn't want the perf hit of doing this,
then they don't need to, it is just an option that they can use to afford
them the most protection, usually during dev/testing.

It is also worth stressing, that the access exception occurs only once (per
user API call) because once the page is set to ReadWrite inside the API lib,
it wont incur any more access exceptions, until after the API chain
ultimately returns to the caller, so it isn't as "bad" a hit as it may at
first seem.

Hugh


.



Relevant Pages

  • OS Question
    ... This isnt strictly about a driver issue, but many driver coders may have ... Basically we plan to user some of the Interlock functions (exchange, ... exchange compare etc) as the basis for a simple fast lock (not in driver code ...
    (microsoft.public.development.device.drivers)
  • Re: OS Question
    ... This isnt strictly about a driver issue, but many driver coders may have ... Basically we plan to user some of the Interlock functions (exchange, ... exchange compare etc) as the basis for a simple fast lock (not in driver code ... Any insights much appreciated. ...
    (microsoft.public.development.device.drivers)
  • Re: OS Question
    ... This isnt strictly about a driver issue, but many driver coders may have ... Basically we plan to user some of the Interlock functions (exchange, ... we trap the exception, run a few checks and then update the page to have ... its access set to Read only. ...
    (microsoft.public.development.device.drivers)
  • Re: Oh dear, train crash !
    ... counterproductive on such vehicles. ... because if the driver had the ability to override the interlock (at ... accident caused by the signalman deliberately overriding the interlocks. ...
    (uk.railway)

Loading