Bug 238496 - IPC::Connection::Connection() is not usable from non-main threads
Summary: IPC::Connection::Connection() is not usable from non-main threads
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks: 238515
  Show dependency treegraph
 
Reported: 2022-03-29 02:23 PDT by Kimmo Kinnunen
Modified: 2022-04-05 02:24 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.25 KB, patch)
2022-03-29 11:33 PDT, Kimmo Kinnunen
kkinnunen: review?
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2022-03-29 02:23:13 PDT
IPC::Connection::Connection() is not usable from non-main threads
Comment 1 Kimmo Kinnunen 2022-03-29 11:33:28 PDT
Created attachment 456047 [details]
Patch
Comment 2 Chris Dumez 2022-03-31 10:14:59 PDT
Comment on attachment 456047 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456047&action=review

> Source/WebKit/ChangeLog:8
> +        Make it possible to instantiate Connection from non-main threads.

Is it OK that even we can now construct an IPC::Connection off the main thread, it will still always get destroyed on the main thread (meaning that the destruction thread differs from the construction thread)?
Comment 3 Kimmo Kinnunen 2022-04-04 01:53:35 PDT
Comment on attachment 456047 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456047&action=review

>> Source/WebKit/ChangeLog:8
>> +        Make it possible to instantiate Connection from non-main threads.
> 
> Is it OK that even we can now construct an IPC::Connection off the main thread, it will still always get destroyed on the main thread (meaning that the destruction thread differs from the construction thread)?

Yes, I think it is sound. This also preserves the assertions in the destructor.

However, currently the feature of constructing in arbitrary thread is not that useful. Also, the feature in practice cannot be used until more of the features (all?) are made thread agnostic. This means the work in this patch is mostly useful only at the point when ~Connection runs in arbitrary thread.
Comment 4 Radar WebKit Bug Importer 2022-04-05 02:24:13 PDT
<rdar://problem/91284136>