vivekvardha / TaskSchedulingAssignment

Attempted to implement code using channel and go routines which mimics priority based scheduling
0 stars 0 forks source link

Duplicate Go routines spotted. #4

Open hariprasadraja opened 3 years ago

hariprasadraja commented 3 years ago
go executeTask(jobs)
go executeTask(jobs)
vivekvardha commented 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.

hariprasadraja commented 3 years ago

Yes. when will it terminate ? and Why you have choose to use 2 go routines instead of 5 or 1.

vivekvardha commented 3 years ago

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.

hariprasadraja commented 3 years ago

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

vivekvardha commented 3 years ago

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.