Why doesn't java use thread-safe data structure for signal?

Hey, I read the go’s example and java’s example for signals and found go used channels which is safe for goroutines and java used just simple ArrayList which is not safe for multithreaded. I feel confused. Will there be a problem if the collection storing signal data is not thread-safe, probably the consuming and producing of data inside the list are not done at the same time so ArrayList suffice here?

1 Like