Bug 238496

Summary: IPC::Connection::Connection() is not usable from non-main threads
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebKit2Assignee: Kimmo Kinnunen <kkinnunen>
Status: NEW ---    
Severity: Normal CC: cdumez, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 238515    
Attachments:
Description Flags
Patch kkinnunen: review?, ews-feeder: commit-queue-

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>