File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes Threads based proj. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Threads based proj." Watch "Threads based proj." New topic

Threads based proj.

Waez Ali
Ranch Hand

Joined: Jan 24, 2005
Posts: 43

I have studied threads but I want to develop one small project to really get clear picture of apis and how it works.

If you know any sources/links/ or you would propose any small proj that I can develop in multithreads.. it would be really helpful.

Thank You
Emanuel Kadziela
Ranch Hand

Joined: Mar 24, 2005
Posts: 186
Incrementing a counter is always a good multithreaded problem. You can try something like this: Have a global counter and n threads which increment it in a thread safe way. Each of the n threads should increment the counter x number of times with x>1. Whenever the counter is incremented, the thread doing the increment should print out its name, the value before and the value after.

If you want bonus difficulty, ensure that no thread increments the counter more than once more than any other thread - in other words, every thread gets to increment before any other thread goes again.
Waez Ali
Ranch Hand

Joined: Jan 24, 2005
Posts: 43
Thanks I will try this out... please let me know any other interesting assignments.
I agree. Here's the link:
subject: Threads based proj.
Similar Threads
Struggling with career startup please advice
CruiseControl: force building project #2 programaticaly from another project #1
question and sample problem about classpath
need help on good multithreading practices