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).

The reason that the current code does a cwd is to optimize creating 
directories.  I'm considering removing it entirely, but will probably do a 
bit of performance testing before doing so ...

Best regards,

Kern

-------------------------------------------------------------------------
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

Reply via email to