Forums Register Login

What to create to learn Threads in java?

+Pie Number of slices to send: Send
I have already created program that simulates traffic lights.

What to create next to learn java threads?


P.S. I don't want conway's game of life.
+Pie Number of slices to send: Send
Have you heard of the producer/consumer problem? That might be a good next problem.
+Pie Number of slices to send: Send
Thanks for reply!

I have done this already and other basic tasks!

I need smth more interesting, but not very difficult.
+Pie Number of slices to send: Send
You want to do those examples to understand concurrency? If yes, then I recommend reading "Java Concurrency in Practice". Although I haven't read it yet, it's a very highly regarded book when it comes to Java concurrency. The reviews are here
+Pie Number of slices to send: Send
I reckon you must have already solved the producer consumer problem using multiple techniques.
I know that blocking queues is the way to go for it, but the other ways teach you the basics that are critical.
But I'm sure you must be past that stage.

I reckon you must have already written programs that use Locks, Conditions etc.

If yes, you might want to write programs that make use of thread pools, executors, and schedulers.
Have you used types like AtomicInteger etc already? If not, just knowing how they work might help.
You could also look at the techniques to minimize synchronization.




+Pie Number of slices to send: Send
By the way, in the book 'Java Threads'- Edition 3, the authors have demonstrated simple concepts in the very first chapter by the means of a simple game. With every chapter
the authors add something more advanced to that same game.
This way they are able to explain to their readers the subtle differences
amongst various approaches.

That same game ... all through till chapter 14.
It's awesome. And when there is a need to explain something more, something different,
you will see a different example. There are several examples in that book and they are examples that
will teach you how to write that kind of code in real applications.






+Pie Number of slices to send: Send
books are boring imo
+Pie Number of slices to send: Send
Certain exercies can be
a. program to create a deadlock . if possible link it with Out of memory error .. take dump and solve the deadlock
b. program to use cyclic barrrier, semaphores, Locks, CountdownLatch etc
OR
we can write a sample Online Bidding web application [ kind of ebay] .. where multiple threads try to bid for same product(s)
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 913 times.
Similar Threads
Conway's Game of Life/Code efficiency
My version of Conway's Game of Life
Gui for Conway's Game of Life
Conway's Game of Life - problems with algorithm and swing
John Conway's Game of Life Algorithm Help
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:46:03.