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

Single thread for blockchain and network dispatcher #84

Open
dakk opened this issue Jul 14, 2018 · 0 comments
Open

Single thread for blockchain and network dispatcher #84

dakk opened this issue Jul 14, 2018 · 0 comments

Comments

@dakk
Copy link
Owner

dakk commented Jul 14, 2018

The current approach of having a thread for blockchain parsing and another thread for network message dispatcher (which has no overhead) is not the best architecture. We can use the same thread for step-execution of blockchain and network. This will provide use a more functional approach.

  • We can split the blockchain step in two steps: the process_net_message and the handle_sync.
  • We can remove the queues, using step result as request/response list (so we don't need a threadsafe queue, and the functional thread will result more clear).

https://github.com/dakk/caravand/tree/single-thread

Minors

  • Avoid reconnecting to the same not-available node
  • Handle shutdown
@dakk dakk changed the title Same thread for blockchain and net Single thread for blockchain and network dispatcher Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant