My week with threads
"How was your week?"
- I was studying the Thread chapter. Threads are concurrently running programs. I found the theory difficult to understand.
- Synchronization is difficult. You can synchronize on methods or on code blocks, but these share the same lock on the object.
"Could you cope?"
- I was stuck on the last exercise. I had created two supervisor threads for a bunch of clerks threads dealing with accounts. Then suddenly the output got all jumbled up. I decided to leave it and get it right the next day.
- I consulted the book again, and the synchronization problem was solved quite easily. I continued chapter 12, on the GUI. I thought I'd might have a look at the API for the swing classes. I couldn't believe my eyes.
Swing is so enormous. The reason I wanted to do Java was to create some nice applets. These are as far away as ever, across an ocean of Swing classes, methods and constants.
If I had known this - the effort it takes to learn Java - I doubt I would have started studying it. Ivor's book is great though, sublime, I could not have hoped for a better guide.