I am kind of new at concurrency (I believe i am doing good with Monitors, Semaphores and reentrantLocks) so i can't use them. I have to use any class or interface from concurrent package.
Point 1.- Few threads must access an array and make a sumatory of its elements (I used Atomic Variables here, there is an atomic variable used as a pointer for the array).
Point 2.- Here, a number of Threads (cars), in a shore have, to cross a river. There is a Thread that simulates a boat. When 10 cars are in the boat it sails to the other shore. This secuance is repeated until all cars crosses the river. I don't really know which ones to use here.
Point 3.- Here, some Threads have to read some information and other Threads have to modify that information (any number of times). I believe here I have to use ReadWriteLock.
Point 4.- A producer / consumer like problem. Here I used BlockingQueue.
Point 5.- Made up an exchanger like problem and solve it (done, really simple one... 2 threads exchanging a String variable).
If you have any recomendation on which method to use in a certain points (like "No, use atomic variables in point 3 and cyclicBarrier in point 1"), will help me a lot!
Thanks!