
On Sun, 31 Aug 2008 18:23:30 +0200, Ion GaztaƱaga <igaztanaga@gmail.com> wrote:
[...]-> main thread handle returned by CreateProcess in PROCESS_INFORMATION structure the must be closed and I can't find this in the code.
Changed (I've added a couple of CloseHandle() calls).
-> child::wait function returns sporadic errors when multiple children are launched and waited. I changed the code from: do { ::GetExitCodeProcess(handle_, &code); ::Sleep(500); } while (code == STILL_ACTIVE); ::WaitForSingleObject(handle_, 0); ::CloseHandle(handle_);
with
::WaitForSingleObject(handle_, INFINITE); ::GetExitCodeProcess(handle_, &code); ::CloseHandle(handle_);
Changed.
->environment::set does not correctly overwrite existing variables):
void set(const std::string &var, const std::string &value) { insert(value_type(var, value); }
should be
void set(const std::string &var, const std::string &value) { this->operator[](var) = value; }
No change required as in Boost.Process 0.3 environment is a typedef of std::map<std::string, std::string>.
-> Using named pipes has been problematic because it returns errors when launching multiple processes aggressively: Error 231 - All Pipes are Busy. This does not happen with anonymous pipes and I think it has some relationship with the guid code. By the way, I think a uuid library is too much to create a unique identifier to be shared with the child a simple atomic count would to the job in my opinion. That would reduce Boost.Process dependencies.
An atomic count might not be sufficient as it would be unique only per process. As I used Boost.Uuid only for convenience though I'll replace it with an atomic count plus a random number to drop the dependency.
-> systembuf::close() should call sync() to push the last charaters into the pipe, othewise, characters are lost if the user does not flush the stream.
Changed (in postream::close()).
-> I've changed the "stream_info::usefile" case in win32_start to support redirecting to files, changing "CREATE_NEW" parameter of CreateFileA with CREATE_ALWAYS.
Changed.
-> And now, the most important one ;-)
Please, avoid tabs! Read boost development guidelines:
Will change it. :) Boris