Re: OS Question

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





"Maxim S. Shatskih" wrote:

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


Hi Maxim

The scenario you outline is correct, but the code isnt designed that way,
you have outlined an issue that a designer must address, but this is not an
incompatibility.

In reality the first thread doesnt reset page access to ReadOnly, the reset
only takes place if the returning thread is the last thread (this is tracked
in a count managed by a critical section).

All of this actually works, and was tested some time back (but the feature
has been dormant and unused for some time, but will be an officially
supported option for users of the API).

Thanks for outlining the issue though, it is a real issue and would be a
design need.

HUgh

.



Relevant Pages

  • Re: vZOOM can handle cross-thread long-term references?
    ... You don't really want a non-polling processor thread to be able to access ... any data on a foreign thread unless you within the context of a memory ... At the end of the entire operation the first thread would contain a 1 in prefs, and the second thread would contain a in prefs. ...
    (comp.programming.threads)
  • [question] read operation problem
    ... I'm writing MPEG program using more than 2 threads. ... First thread read MPEG data from MPEG hardware and write data to file. ... Second thread read file and send data to client program. ...
    (comp.os.linux.development.apps)
  • Re: [question] read operation problem
    ... > I'm writing MPEG program using more than 2 threads. ... > First thread read MPEG data from MPEG hardware and write data to file. ... > Second thread read file and send data to client program. ...
    (comp.os.linux.development.apps)
  • Re: vZOOM can handle cross-thread long-term references?
    ... You don't really want a non-polling processor thread to be able to access ... any data on a foreign thread unless you within the context of a memory ... How first thread pass pointer p to second thread - this is separate ...
    (comp.programming.threads)
  • Re: System.Runtime.InteropServices.InvalidComObjectException: Com object that has been seperated fro
    ... > And in the second thread am trying to read an Excel file. ... > smoothly.Its in the first thread am facing the error: ... > user, String password, String authority, Int32 impersonationLevel, Int32 ...
    (microsoft.public.dotnet.framework)