Raynes/fs — Issue #22: cwd not thread-safe
Author: franks42
Created: 2012-02-18 20:05:43+00:00
State: open

when you use fs.core/chdir from different threads concurrently, the single instance of cwd will get updated by all, which makes it kind of indeterministic,,, an alternative would be to make cwd thread-local or maybe inheritable-thread-local is better, but unfortunately that would break backwards compatibility as you would need a double deref "@@cwd" - or maybe there are other solutions (?).
I've forked your fs and implemented a solution based on inheritable-thread-local - didn't want to add a pull request as it breaks backwards compatibility - i'd be happy to contribute it - pls take a look: https://github.com/franks42/fs
(the inheritable-thread-local is based on useful.utils/thread-local but initializes the thread-local value with the parent's thread one).
-Regards, FrankS.