+ 2
Producer Consumer Problem in Java
I know three methods of solving: 1. By using Blocking queue 2. By using synchronized and wait,notify. 3 And other By using Semaphore . My question is which is the best approach of solving the problem.
1 Respuesta
+ 1
This surely depends on your problem and its specific requirements (for example speed, number of threads, ...).
I just want to throw in another solution, namely the reactive model of RxJava. It's a really cool framework for solving those problems on an other level of abstraction.