summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretobi <git@e-tobi.net>2011-10-05 02:07:17 +0200
committeretobi <git@e-tobi.net>2011-10-09 19:15:53 +0200
commitfbd5b7c271afaa0a1cb8fbc3793dd7a55eca24dc (patch)
tree0cd4bfae9c2099ea238a9d109aaadc2afd073e3e
parent0a40e921a330ca63e453089e56df392f4140a6c5 (diff)
downloadvdrnfofs-fbd5b7c271afaa0a1cb8fbc3793dd7a55eca24dc.tar.gz
vdrnfofs-fbd5b7c271afaa0a1cb8fbc3793dd7a55eca24dc.tar.bz2
Disable multithreading in Fuse
-rw-r--r--DEVELOPERNOTES8
-rw-r--r--vdrnfofs/vdrnfofs.py1
2 files changed, 9 insertions, 0 deletions
diff --git a/DEVELOPERNOTES b/DEVELOPERNOTES
new file mode 100644
index 0000000..b990dd4
--- /dev/null
+++ b/DEVELOPERNOTES
@@ -0,0 +1,8 @@
+Fuse might call read(...) on the file class from multiple threads, causing
+a race condition with the underlying seek/read operations.
+
+Using locking here seems to make the file access slower, than just disabling
+the multithreading in Fuse with fs.multithreading = False.
+
+A thread-local storage doesn't help either, because Fuse doesn't seem to
+reuse threads, but might create new threads for each read operation.
diff --git a/vdrnfofs/vdrnfofs.py b/vdrnfofs/vdrnfofs.py
index db3a247..67a44e1 100644
--- a/vdrnfofs/vdrnfofs.py
+++ b/vdrnfofs/vdrnfofs.py
@@ -147,6 +147,7 @@ def main():
version = "%prog " + fuse.__version__
fs = VdrNfoFs(version=version, usage=usage, dash_s_do='setsingle')
+ fs.multithreaded = False
fs.parser.add_option(mountopt="video", default='', help="The video directory containing the VDR recordings")
fs.parser.add_option(mountopt="log", default='', help="The log file (default = console)")
fs.parser.add_option(mountopt="loglevel", default='info', help="The log level (debug, info, warning or error)")