Bug 270118 - Replies from GPUConnection::Connection::sendWithAsyncReply will always be called on the main thread
Summary: Replies from GPUConnection::Connection::sendWithAsyncReply will always be cal...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 270277 270282
  Show dependency treegraph
 
Reported: 2024-02-26 13:52 PST by Jean-Yves Avenard [:jya]
Modified: 2024-02-29 06:46 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2024-02-26 13:52:14 PST
When you send a message from the GPUConnection::connection()->sendWithAsyncReply (or sendWithPromisedReply), the reply will always be dispatched from the main thread.

It can make for some surprising behaviour when a WorkQueueMessageReceiver expect an answer on its defined work queue.
Comment 1 Radar WebKit Bug Importer 2024-02-26 13:52:32 PST
<rdar://problem/123650202>
Comment 2 Jean-Yves Avenard [:jya] 2024-02-26 14:09:30 PST
A solution would be to have an override for `Connection::sendWithAsyncReply` that takes a SerialFunctionDispatcher on which the reply will be called on and pipe things internally to either dispatched the reply to Connection::dispatcher() or that defined SerialFunctionDispatcher.
Comment 3 Jean-Yves Avenard [:jya] 2024-02-27 04:28:04 PST
Pull request: https://github.com/WebKit/WebKit/pull/25092
Comment 4 Jean-Yves Avenard [:jya] 2024-02-27 04:37:32 PST
Pull request: https://github.com/WebKit/WebKit/pull/25166
Comment 5 EWS 2024-02-29 06:46:30 PST
Committed 275494@main (cae00d824a49): <https://commits.webkit.org/275494@main>

Reviewed commits have been landed. Closing PR #25166 and removing active labels.