Offline repost #2

I'm exactly sure what the problem with my current code is, but it seems that there's a bug appearing from time to time depending on the thread execution order that'll will result in a endless loop when waiting on the ressource manager to finish when there are still ressources not unloaded. That's connected to something where the tasker seems to not finish but has indeed an empty set of task lists. So since the thread should actually end there, I guess it's something related to a mutex lock still beeing on or something else related to illegal thread object adresses or so. I'd spam debug functions in all my modules, but this brings a few problems with forgetting to remove them later and so on, so that I've decided to create a macro-based debug system one can activate/deactivate in the main file if desired. Making debug messages for everthing is simple with printf wrapper, but deactivating specific modules is a bit more difficult. I think I'll try a bit with several ifdef locks or something like that. Maybe I could use something like GDB or so but I doubt it'll be as useful as including code directly. In the end I'll also be able to use it as a generic log and a debug possibility in production-quality code. It'd effectively the log function I ever wanted but didn't start in the past. I hope this will work out properly and that I'll be able to solve my problem with no huge work effort.

I really do hope this works out. Weird errors can only be solved by proper logging and analysing. Currently, I don't have any way to do so without creating those macros. And the fact that my gaming PC is not available right now makes me feel even worse but probably gives me the time working on my program without any videogame distraction. Ugly.

No comments: