Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse a dedicated thread to buffer payloads, so avoiding deadlock #2480
Conversation
|
r? @glennw |
|
Some CI tidy failures:
|
|
@glennw fixed |
|
Looks good! Let's squash the commits and then this is ready to go. |
…d by blocking ipc send
9a7b2d2
to
8bed771
|
@bors-servo r=glennw |
|
|
…=glennw Use a dedicated thread to buffer payloads, so avoiding deadlock Fixes #2478 The problem is that sending a transaction first sends the payloads, then the transaction. This causes deadlock if sending the payload blocks, since the transaction is never sent, so the payloads are never removed from the buffer. This PR fixes that, by adding a dedicated thread that routes from the payload IPC channel to a payload mpsc channel. It also removes a hot loop in the case of missing payloads. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2480) <!-- Reviewable:end -->
|
|
|
I wonder why we couldn't send the payload after transaction, which would also resolve the deadlock. |
|
@kvark that would probably fix the problem, but a) it puts the WR thread into a hot loop until the payload arrives, and b) it tightly couples the sender and receiver which then have to agree about which is the current channel, which is rather brittle code. In the long run I think the plan is to move WR over to just using mpsc channels, and move any ipc over to the application. |
asajeffrey commentedFeb 28, 2018
•
edited by larsbergstrom
Fixes #2478
The problem is that sending a transaction first sends the payloads, then the transaction. This causes deadlock if sending the payload blocks, since the transaction is never sent, so the payloads are never removed from the buffer.
This PR fixes that, by adding a dedicated thread that routes from the payload IPC channel to a payload mpsc channel. It also removes a hot loop in the case of missing payloads.
This change is