Closed zhu121 closed 2 years ago
Hey @zhu121,
maxWorkers
option (int
), which imposes another limit to the value it can have (the exact value depends on the system architecture, 2147483647
for 32bits and 9223372036854775807
for 64bits).I hope these answers are helpful. Thanks!
@alitto thank you for your reply. Here's a little suggestion File: pond.go Line: 417 Will it be more consistent to change the parameter tasks of the worker function to 'tasks <-Chan func()', because the worker's operations on tasks are read-only
Good point @zhu121, that's right, the tasks
parameter could be of type <-chan
since it's only read within the worker function :slightly_smiling_face:
When analyzing the code implementation, it is found that adding tasks and removing tasks are multiple goroutines accessing the same channel.
Some questions: 1.Will there be an upper limit on the number of goroutines(the number of workers)? 2.Will there be a significant impact on performance when the number of goroutines is greater?
Look forward to your reply.