Relative Content

Tag Archive for gogoroutine

goroutine problem-the data is not modified when operating on the same variable

This is a transaction execution simulation based on a dependency graph. I used coroutines to execute in parallel. The dependency graph records whether there is a data dependency relationship between the execution of transactions. Transactions without dependencies can be executed in parallel. But I encountered a problem. The program was blocked during testing. When I debugged, I found that the modification of monitorResult and duplicateG in the goroutine would not be successful, resulting in an infinite loop without changing the size of duplicateG. How to solve this problem?