On Monday 03 September 2007 14:21, Martin Simmons wrote: > >>>>> On Sat, 1 Sep 2007 12:15:50 +0200, Kern Sibbald said: > > > > Hello, > > > > In starting to eliminate the current makepath code used the make a full > > path for restore, I rewrote save-cwd.c, which saves and restores the > > current working directory. Two things occurred to me: > > > > 1. This code is terribly inefficient because it saves and restores the > > current working directory on *every* path that it creates during a > > restore, and possibly for every file it creates. With a little bit of > > work, it could be done once. > > > > 2. It seems to me that changing the current working directory is > > something that effects all the threads of the program -- i.e. it is not > > really "thread safe". This means that as long as that code exists in > > Bacula, one can do only one restore per FD at a time. Simultaneous > > restores in the same FD will most likely create chaos as two threads are > > modifying the cwd at the same time!!!! > > > > If anyone knows whether or not changing the cwd can be simultaneously > > done by multiple threads or not, please let me know (in any case, it is > > clear that it will not work unless you have threads implemented in the > > kernel). > > It affects all threads. Ditto umask (which I see is also called in > attribs.c).
Hmmm. I guess I either need to document that or start using mutexes ... Thanks, Kern > > __Martin ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
