Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace QMetaObject::invokeMethod with atomic operations #127

Closed
wants to merge 1 commit into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Nov 2, 2020

No need to read/write a data member in one thread if it is atomic.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An atomic bool would be enough?

Didn't want to mess with this in #120 because I think ballon filtering doesn't belong in transaction model. IMO the right place should be aware of what wallets are open.

@hebasto
Copy link
Member Author

hebasto commented Nov 7, 2020

@promag

An atomic bool would be enough?

You're right. Reworked.

@hebasto hebasto changed the title Replace QMetaObject::invokeMethod with Mutex locking Replace QMetaObject::invokeMethod with atomic operations Nov 7, 2020
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work: setProcessingQueuedTransactions needs to be enqueued and proceed in between transaction notifications.

@hebasto
Copy link
Member Author

hebasto commented Nov 12, 2020

This doesn't work: setProcessingQueuedTransactions needs to be enqueued and proceed in between transaction notifications.

Why?

@promag
Copy link
Contributor

promag commented Nov 12, 2020

Transaction notifications are enqueued in TransactionNotification::invoke and by the time they are processed setProcessingQueuedTransactions(false) was already called.

@hebasto
Copy link
Member Author

hebasto commented Nov 12, 2020

You mean that setProcessingQueuedTransactions must be placed into the same event queue as updateTransaction, i.e., coordinated?

@hebasto hebasto closed this Nov 12, 2020
@promag
Copy link
Contributor

promag commented Nov 12, 2020

@hebasto yes, processingQueuedTransactions() value is worthless.

@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants