[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [PATCH] Do not disable txn-list-lock on Windows

From: Bert Huijben <bert_at_qqmail.nl>
Date: Mon, 17 Feb 2014 01:59:19 +0100

> -----Original Message-----
> From: Evgeny Kotkov [mailto:evgeny.kotkov_at_visualsvn.com]
> Sent: maandag 17 februari 2014 01:37
> To: Subversion Development
> Subject: [PATCH] Do not disable txn-list-lock on Windows
> Hi!
> I've noticed that txn-list operations are not being synchronized on
> around trunk_at_1568806. FSFS makes use of two different types of locks:
> there
> are mutexes synchronizing the fcntl file locking (POSIX only) and ordinary
> mutexes (e.g. txn-list-lock). The former are only required on POSIX, the
> latter, however, should be enabled under all OSes.
> Since r1182459 [1], the txn-list-lock mutex is being erroneously enabled
> disabled under the same condition as the mutexes required for the fcntl
> locking
> mechanism to work. This effectively makes the txn-list operations work
> without
> any serialization on Windows.

Not sure if this is related:

But you do know that Windows has completely different file semantics than
posix, don't you. You can just use the standard file locking to have proper
locking between threads, which doesn't work on many other platforms. (A
process is free to shoot itself in its foot there when it wants to write a
file locked via a different handle on those platforms. Locks are per handle
on Windows, per process on Posix)

On Windows file access is already synchronized by the OS, so it is not
necessary to apply your own layer again, just because you have to do the
same thing on other platforms.

Do you have a specific scenario that fails for you?

Are there better ways to fix this than adding yet more mutexes? FSFS should
be able to rely just on the filesystem locks on Windows.

Just adding more mutexes without a proper locking design will eventually end
in a complete deadlock once the order of obtaining is reversed. (We just had
a huge number of mutexes added in a different place earlier this weekend...)

In the past we had many slowdowns specifically on Windows, because
implementations on other platforms assumed that things were necessary on
windows.... and in their tests on other platforms things were very fast.
(E.g. truename lookups in apr... Which are a no-op on any platform except

Received on 2014-02-17 01:59:59 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.