Skip to content

Content() Pending() ToJournal() Lock -> RLock#104

Open
KyrinCode wants to merge 1 commit intodevfrom
kyrin/txpool-rlock
Open

Content() Pending() ToJournal() Lock -> RLock#104
KyrinCode wants to merge 1 commit intodevfrom
kyrin/txpool-rlock

Conversation

@KyrinCode
Copy link

According to upstream go-ethereum maintainers and after an analysis, though SortedMap is not thread-safe, the upper design pattern has dealt with the concurrent access. Modifying methods like Put and Forward are warped by Lock in the upper callers. And Flatten is read only method, in which the cache is protected by its own m.cacheMu.Lock.
Plus, ContentFrom method already uses RLock, so it's safe to do this conversion.
ethereum/go-ethereum#32924
This PR in go-ethereum is highly likely to be merged. We can modify this at first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant