Skip to content

Comments

Update staging#1

Open
afilini wants to merge 8 commits intoBP-WG:stagingfrom
afilini:update-staging
Open

Update staging#1
afilini wants to merge 8 commits intoBP-WG:stagingfrom
afilini:update-staging

Conversation

@afilini
Copy link

@afilini afilini commented Jul 28, 2020

No description provided.

afilini and others added 8 commits July 9, 2020 16:11
This new model is based on the idea of having only one thread monitor the socket and then
distribute the responses to every other thread that's waiting.

Whenever a request is made, a new mpsc channel is created and added to an internal map.
Then, if there are not other threads waiting for pending responses, that thread will
become the "reader thread" and monitor the socket until it receives the response it was
waiting for. In the meantime, if it sees responses coming on the socket with different
ids, it will lookup the correct Sender from the internal map and send that message to
the thread that created the request in the first place.

The other threads will be waiting trying to read from their Receiver, where they will
either get the message in response to their request, or a signal to wake up and
become the new "reader thread".
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.

2 participants