Closed davidfoerster closed 9 years ago
I agree, that some tasks should be loaded off to worker threads, in particular long input/output operations like network requests (e. g. search requests and resource/image downloads) and later some computational tasks (e. g. speech transcription or other complex audio analyses). An alternative for I/O would be an event handler loop waiting for termination of those operations and dispatching their results (reactor pattern).
The current event handling is a sham, because long, blocking (network) operations run synchronously in the event dispatcher thread of the user interface, stalling/freezing it in the mean time.
This requires some sort of synchronisation between concurrent threads, of course, and your recommendations go into the right direction, but you seem to be unaware, that Java provides
synchronize
keyword to denote critical sections handled and enforced by the runtime environment andI am unaware of what Java provides. But I emphasise that working on this is vital for user experience.
Implemented as of 6212ddb7841e0eef40b5516b3f4da6e8047b94c6.
From @Disastergirl on May 26, 2015 11:37
Threading is needed to continue the animation while the requests for data continue to run. Create a bunch of "worker threads" and have those worker threads go through a common job queue.
Copied from original issue: Disastergirl/Kaleidoscope#5