As a precursor to #1001 and many future units of work
Create a system that allows one to take a collection of tasks, split them over multiple threads and work in parallel (fixed thread pool), and keep main thread paused while these tasks are being executed.
Tasks executed under this system should not be considered async, and should not trigger the Async Catcher. The Async Catcher logic in various places needs to ignore this.
The pool execution should offer the ability to optionally set a time limit on work, as a way to distribute low priority tasks such as the lighting queue, that can 'stop processing' and leave unfinished work in the event the ticks time is up (50ms)
If that flag is not set, it should tick the pool until all tasks are completed.
This API can then be used for numerous performance improvements in the server software, such as #1001
See #1001 for some concurrency concerns for plugins (As we have to account for these parallel tasks triggering events that need to still be considered sync)
This system will not be exposed over API, as plugins would then have free form access to modify collections concurrently.
We will only use this system in ways that we feel is safe that code will not modify collections concurrently (At least that we didn't account for) such as entity/tile entity.
Progress has started on this @ https://paratask.emc.gs
Implementation note: need to design a system like the Async Chunk Loading system has where while paratask is blocking main, have the ability for the worker threads to send work to process back on main for things such as event fires.
This solves nearly every concern with doing things concurrently in that we avoid having plugins events firing off main concurrently.
in .callEvent we would check current thread, and if its a ParaTask thread, do paraTaskThread.getManager().executeMain(runnable);
this will block the paratask thread until main has processed the event, allowing the paratask thread to then check cancelled state, etc.
Any thing new?
Please dont bump this. this is a super low priority.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Please dont bump this. this is a super low priority.