I couldn't do too much during last week (weekend was "lost") but I still did few things that I am really happy about. Of course those were related to porting to c++ as I was sucked in by creating basic systems to be able to port whole code to c++. But boy, it was fun!
I have arrays and lists. I have some concurrency mechanisms, own thread management (threads without affinity masks set up), own immediate job queue system - I have immediate jobs queue and I want to add async job queue and a helper class that will support multiple queues with priorities. I'd like to make it work on as many cores as possible with basic separation into:
I have arrays and lists. I have some concurrency mechanisms, own thread management (threads without affinity masks set up), own immediate job queue system - I have immediate jobs queue and I want to add async job queue and a helper class that will support multiple queues with priorities. I'd like to make it work on as many cores as possible with basic separation into:
- main thread (responsible for adding tasks for other threads, that will also do single threaded immediate jobs and all other immediate jobs)
- rendering thread (will only do rendering and maybe some immediate jobs and/or background loading)
- background tasks thread (will do background tasks and will load things in background, and do immediate jobs if nothing else to do)
- immediate jobs threads
With such approach, I will have one thread doing rendering. One thread for single threaded immediate jobs (all physical activity that can't happen at the same time as other systems). One thread reserved for background tasks (it shouldn't happen very often and loading should go there, but on more cores I could have more background task threads and separate background loading thread(s)) and all other threads for immediate jobs (AI/logic, animation system, particles). And I want to pack everything together, so at any time there won't be any idle thread. I need to come up with list of jobs (basing on what I wrote above) and priorities for all threads.
And of course I want to make it possible to run on single thread too, as it will be easier to debug stuff and some computers may have just one core.
When creating code in vala I was already thinking about parallelization and I made clear separations in as many places as possible. With vala I could still do same things but it would be slower (in execution), it would be much harder to debug and I would have to add mechanisms that vala doesn't support by default and would introduce some mess into the code (there's no easy way to do pooled objects, not as easy as in c++).
For now I would still like to do missing bits (async job queue, job execution class) but I am switching back to vala to add things that are missing for this milestone.
And of course I want to make it possible to run on single thread too, as it will be easier to debug stuff and some computers may have just one core.
When creating code in vala I was already thinking about parallelization and I made clear separations in as many places as possible. With vala I could still do same things but it would be slower (in execution), it would be much harder to debug and I would have to add mechanisms that vala doesn't support by default and would introduce some mess into the code (there's no easy way to do pooled objects, not as easy as in c++).
For now I would still like to do missing bits (async job queue, job execution class) but I am switching back to vala to add things that are missing for this milestone.
No comments:
Post a Comment