I have a program perfect for threading. Except at the core of the critical loop I call a Swing method. So how do I best do this?
A) Surround the Swing.method() with locks. Sounds slow.
B) Come up with an Object that threads create and the Swing thread interprets, and queue them up. Sounds like a lot of work with lots of threading gotchas.
C) Just store things in an array and Swing.method() does them when the threads are all done. This loses half the benefit of threading.
D) Don't worry about it, the results could be mighty interesting. I think I'll do this just for fun
This is not just my first Java threads program, it's my first threads of any sort. I've got a lot of experience with multi-process programs, none with threads.
A) Surround the Swing.method() with locks. Sounds slow.
B) Come up with an Object that threads create and the Swing thread interprets, and queue them up. Sounds like a lot of work with lots of threading gotchas.
C) Just store things in an array and Swing.method() does them when the threads are all done. This loses half the benefit of threading.
D) Don't worry about it, the results could be mighty interesting. I think I'll do this just for fun
This is not just my first Java threads program, it's my first threads of any sort. I've got a lot of experience with multi-process programs, none with threads.