![]() |
Re: ofstream (standard C++ file output) not working
Right, so if it is called before fopen() in the same thread, why would there be a race condition?
I think we're having some kind of communication disconnect. Sorry. |
Re: ofstream (standard C++ file output) not working
Quote:
If what you are saying is that you are calling it in the same task before the fopen and it still only works some of the time, then I don't have a good theory for you. Let me know if this is the case and I'll try to look into it a bit more. -Joe |
Re: ofstream (standard C++ file output) not working
A race condition would make sense, originally, I had the write in the simple template constructor, later i put it in the auto. I will test out the race condition today. My plan:
write to file in entry point function before anything else write to file in robot constructor write to file in robot auto after 10 second wait they will be tested 10 times without priv_set..., and 10 times with priv_set... I will report back later |
Re: ofstream (standard C++ file output) not working
Hmm, I am not seeing any blocked attempts to write; Every test was successful, without the priv_set... Sometimes it took up to 10 seconds to find it over FTP, but every test was successful
|
Re: ofstream (standard C++ file output) not working
Quote:
|
Re: ofstream (standard C++ file output) not working
Quote:
|
Re: ofstream (standard C++ file output) not working
Quote:
|
Re: ofstream (standard C++ file output) not working
no, but I think it might be the code is slow (I only immediatly looked at the folder for a few test), you hit Run kernel task and it downloads, (I was measuring from that point), it calls the entry point function, and inits everything before creating the file
|
Re: ofstream (standard C++ file output) not working
We finally got our log working consistently (although not as sophisticated as 3132's Logger, it's a foundation in which stuff can be added on). It looks like the race condition problems listed above were the culprit. The key is not to completely overwhelm it with added lines in the main loop.
We have wrapped it in a class if anyone's interested: http://gist.github.com/296373 |
| All times are GMT -5. The time now is 12:31. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi