Time to commit remote ops for VirtualAllocEx, CreateRemoteThread

Thomas Kho tkho at ucla.edu
Fri Aug 4 16:32:39 CDT 2006


On 8/4/06, Alexandre Julliard <julliard at winehq.org> wrote:
> "Dan Kegel" <dank at kegel.com> writes:
>
> > Tommy's APC version of his
> > VirtualAllocEx / CreateRemoteThread patch
> > seems to be safe (since APCs only run a points where threads
> > in well-written programs are not holding locks),
>
> Unfortunately there's no such guarantee, kernel APCs will run on every
> wait.

I'm not too clear why this is a problem. I thought that kernel APCs
run on just interruptible waits, which excludes the wait on suspend
and perhaps others.

Also, I was under the impression that only locks taken in the code
path of the VM and thread creation functions had to be respected. If
necessary, non-interruptible waits could/should be done while holding
these locks (although I looked through the code and it doesn't look
like any applicable code does a wait while holding a lock).

As a side note, there was a bug in my APC implementation--the process
APC queue was flushed on every thread cleanup.

Tommy



More information about the wine-devel mailing list