I’m a beginner on parallel computing. I’ve been working on Java in Apache Netbeans. My recent work was about semaphores, using the Semaphore and Thread Java classes, in that sense, I had to make a program that simulates with progress bars a credit card delivery process that depends on five sub processes (simulated with the threads). Each sub process has a time that is simulated in the program, in this case, using the method sleep from the threads. The semaphore implementation is to progressively increment the general bar depending on the other processes, if one of these is completed then it can be filled in the general bar. Something extra to add is that the sub processes also have their respective progress bars. My problem occurs in the classes BarraGeneral and SubProceso, these represent the general process and one sub process. In their overriden run methods is where I simulate the time and, of course, I do the drawing, but this is not happening. I can say it actually works because on console you can check the prints, the problem as I said is that the bars are not reflecting this progress, it just goes from 0% to 100%.
I tried to solve it by reducing the sleeping simulation time, but that is not the problem. Also I debugged, and the bars are actually changing its value in each iteration.
ruper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.