Open hariprasadraja opened 3 years ago
One part of the problem statement is "span n number of go routines as you wish" So over here I tried spanning n no. of go routines.
Yes. when will it terminate ? and Why you have choose to use 2 go routines instead of 5 or 1.
These will terminate once there are no more tasks to be executed in the priority queue. No specific reason to choose two go routines. The intention is show the usage of multiple go routines. I can spawn more than 2 g routines as well.
These will terminate once there are no more tasks to be executed in the priority queue. - wrong . In your case, go routines won't terminate until main does.
No specific reason to choose two go routines. - you must have a reason
Yes, you are correct. When I reduced the number of tasks to 5, I am able to verify your statement.
working on to rectify it.
Go routines here are mimicing the cores of processor :) Two goroutines means two cores.