ntdll: enable CreateRemoteThread and RtlCreateUserThread for remote processes

Thomas Kho tkho at ucla.edu
Mon Jul 17 21:14:25 CDT 2006


On 7/17/06, Alexandre Julliard <julliard at winehq.org> wrote:
> "Dan Kegel" <dank at kegel.com> writes:
>
> > I'm afraid I don't quite understand.  What's wrong with interrupting a thread
> > holding a lock?  Could that make cloning a new thread deadlock?
>
> One problem is that many locks have to be acquired in a specific order
> to avoid deadlocks, and since you don't know which locks the thread is
> already holding you can't guarantee the order. The other problem is
> that you can't guarantee that critical sections are in a valid state
> since the thread could be interrupted in the middle of a crit section
> call.

I was thinking that cloning the process could take care of deadlocks.
What if the cloned thread fudges its teb and sets a different thread
id than its cloning thread? This invalidates all locks in the cloned
thread taken by the cloning thread. Both threads continue and any
contention would be handled in the already thread-safe manner.

Thomas Kho



More information about the wine-devel mailing list