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

thread safe

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Mon, 03 Sep 2012 20:47:59 +0200

Hi,

It seems that the svn_config_t structure isn't thread safe, i.e. can't
be shared among multiple threads.
See here for a detailed report on what problems this causes:
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3003152

Is this by design? I assumed that all svn APIs are thread safe for read
access at least unless noted otherwise (example: the API
svn_utf_initialize states its thread-unsafeness in the note section of
the docs).

While we can work around that thread problem a little bit, that
workaround has its own big problems:
* each thread would need its own svn_config_t structure
   --> for each thread the config file is read (open, read, close)
   which results in multiple unnecessary disk accesses
   --> when the config file is read multiple times, sometimes the read
   fails (at least on Windows) because the file is opened already -
   usually because virus scanners open and scan every file that a
   process accesses, even when only for reading.

Joel Jirak made a patch for subversion/libsvn_subr/config.c which would
fix the problem (see the thread linked above). Would that be an
acceptable solution?

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
Received on 2012-09-03 20:48:36 CEST

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.