|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#31
|
||||
|
||||
|
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. |
|
#32
|
|||
|
|||
|
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 Last edited by jhersh : 04-02-2010 at 15:21. |
|
#33
|
||||
|
||||
|
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 |
|
#34
|
||||
|
||||
|
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
|
|
#35
|
|||
|
|||
|
Re: ofstream (standard C++ file output) not working
Make sure your FTP client is not caching the directory listing. What client are you using?
|
|
#36
|
||||
|
||||
|
Re: ofstream (standard C++ file output) not working
FileZilla
|
|
#37
|
|||
|
|||
|
Re: ofstream (standard C++ file output) not working
Hmm... should be fine as long as you refresh and are connected. Have you tried putting prints to go along with your writes to get some idea of when the write happened vs. when you see the file on the FTP server?
|
|
#38
|
||||
|
||||
|
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
|
|
#39
|
||||
|
||||
|
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 Last edited by davidalln : 05-02-2010 at 18:36. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| p2 not working? | Lone_Wolf92c | Programming | 5 | 22-02-2008 08:49 |
| IR Board Not Working (But NOT Fried) | itsme | Electrical | 2 | 18-02-2008 06:11 |
| Beware - transmission output shaft is not 5/8"! | jskene | Kit & Additional Hardware | 30 | 13-02-2006 14:01 |
| Drive() Not a Standard Toolset in EasyC? | Chris_Elston | Programming | 3 | 08-02-2006 09:01 |
| Beware - transmission output shaft is not 5/8"! | jskene | Technical Discussion | 3 | 19-01-2006 14:24 |