The Threading is a very difficult thing. The AROS side is working (I guess) but the fpc side is not working properly this time. Everything works fine as long I do not use and AnsiStrings or WideStrings inside the threads. The memory manager destroys the stack of the threads and at the end it will crash, always. The only way I found, until now, to stay with shortstrings. It must have something to do with the threadvars, that are variables with different contents depending in what thread you are. I try to figure out what to do to get this threadvars to work. Long things short I failed … seems there I really need help. I think my thread implementation is wrong at the moment… I implemented the TThread class there I call the AROS threading things… but it seems to me that there I only need to call the abstract functions of the Threadmanager and implement the threadmanager functions for starting threads. (I only implemented there the Crititcal sections). But because thats not a class its a little bit more difficult.. and I do not see it become would better there.
A big problem is the debugging… there is real useable debugger.. I tried once with the hosted compile with debugging and then with the linux gdb (thats the suggested method). It is really bad, you can not really trace the program, because the whole System is with debug informations he jump here and there…. seldom come back to my program.
So in the end there is only the debug output for debugging. Long time before I introduced the Debugln() function to AROS so one can easily write Debugoutput to the error console and show in the hosted linux shell or open sashimi and see directly in AROS. Sadly both are not very comfortable ways (but fast 😉 ) both are lacking of informations who sent the output and what time, for me with threading always important informations, So I always implemented that inside my threads, which is bad because I need strings for that :-P. And in principle the information is there when the debug output is written.
The solution is a little program to catch the debug output identify the task and notice the time. I gave it a little fpGUI interface for better handling. As long the complete AROSbox crash sometimes without giving me the chance to read the output i included a network interface. The messages can be sent via UDP to a windows or linux slave program who show it or sent it further to a file or system log (Linux: Syslog viewable with tail, Windows: OutputDebugString, viewable with DebugView from Microsoft)
it gets an own page:
AROS Debug View