Re: OS Question
- From: Hugo gleaves@xxxxxxxxxxx> <hugh<underbar>
- Date: Tue, 13 May 2008 00:28:01 -0700
"m" wrote:
More importantly, the 'protection' that this scheme offers does not existYes this is absolutely true, and documented for users of the API. There is a
for a period of time when the API call is executing and so any 'rogue' code
can just write to the page then and it will be trashed.
Maxim's situation could be remedied by handling the second exception or
using locks on the APIs to prevent concurrent access to pages.
"Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx> wrote in message
news:e%23jB2tHtIHA.4912@xxxxxxxxxxxxxxxxxxxxxxx
Can you explain? what is not compatible with multithreading? If there is
- 2 threads wants to write access the same data
- first gain the access
- second thread gains the access
- first thread does its work and returns
- on return, the data is marked back as read-only
- then second thread try to do work, and the data is read-only, a crash
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
window during which one thread has enabled write access (but only to the
pages it is touching) whilst another thread, not inside the API, erroneously
writes to one of the pages and causes damage.
This is sadly beyond our reach as a goal, but nevertheless the whole feature
is an option and mainly one that new users code will use during testing,
although there is a window I think the benefit afforded far outweighs this.
I think that in a future design, it might be possible to locate "some" of
the API inside some sort of kernel mode component but my knowledge of device
drivers (especially when used in such a "utility" fashion) is not very good.
Windows unfortunately provides no "out of the box" way for programmers to
write application code that can enjoy the same benefits as drivers (i.e. the
context mode change that allows drivers to access/update kernel structures or
pages allocated in one of the kernel heaps).
Hugh
.
- References:
- OS Question
- From: Hugo gleaves
- Re: OS Question
- From: Alexander Grigoriev
- Re: OS Question
- From: Hugo gleaves
- Re: OS Question
- From: Maxim S. Shatskih
- Re: OS Question
- From: Hugo gleaves
- Re: OS Question
- From: Maxim S. Shatskih
- Re: OS Question
- From: m
- OS Question
- Prev by Date: Re: OS Question
- Next by Date: Re: OS Question
- Previous by thread: Re: OS Question
- Next by thread: Re: OS Question
- Index(es):
Relevant Pages
|