Re:A Proposal for Adding Generics to Go
by boyter on Tuesday January 12, 2021 @02:25PM
(#25752085)
Not familiar with Ada but the inability to stop running goroutines from outside it is annoying and leads to a lot of state telling them to exit. Sometimes I just want it to stop now.
[ Parent
| on HN ]
It's not like on pthread where we have a trhead handler, that will complicate many things.
Like you said, We stop the go routine by telling it to exit the function, it's quite straightforward I think. Not more than a channel and switch case (+ context)
Re:A Proposal for Adding Generics to Go
by rbranson on Tuesday January 12, 2021 @03:33PM
(#25753156)
How would you expect that to actually work though? If a goroutine could be arbitrarily stopped at any point, that would trivially lead to degenerate program states. A lock could be held open or another goroutine could be waiting on it for a message.