• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Multi Threading

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I've been asked to do an assignment on multi threading and I'd like to choose a topic that's nice and appropriate to base my code on. And mind you, I don't want to add two vectors in separate threads.
Do you guys have any ideas / references you might point me to (links, books even) where there's a nice and thorough treatment of this subject ?
Much obliged,
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Have you checked out https://docs.oracle.com/javase/tutorial/essential/concurrency/
It is comprehensive and covers all important aspects. Of course in case you run into problems, you can always post here!

Nice appropriate topic?
25 college kids walk into a bar. There are 2 bartenders. Being well mannered, the kids queue up nicely, each awaiting his/her turn. As soon as a bartender is free, they step forward and place their individual order.
Considering the orders are different, come up with a code which will demonstrate time taken by each bartender, ids of kids served, sequence served and the total time elapsed till all kids sit at a table and hoist their glasses.
 
Ranch Hand
Posts: 115
11
IntelliJ IDE Clojure Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maneesh's idea sounds fun.

If you want something trickier, you could also do something along the lines of a synchronization problem I remember from my OS course back in University. Hopefully I remember the details correctly...

You have two food dishes, two mice, and six cats. The goal is that all eight animals get to eat, except that a cat and a mouse can't be at the bowls at the same time (otherwise the cat will eat the mouse!). Both bowls should be in use when possible, so you can't just queue all the animals on one bowl. I think the length of time each animal spent eating, and how long before it needed to eat again was random, so you can't just set up some sort of round robin, because then throughput suffers.
 
Normally trees don't drive trucks. Does this tiny ad have a license?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic