WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
231418
Clearly distinguish serial from concurrent WorkQueue
https://bugs.webkit.org/show_bug.cgi?id=231418
Summary
Clearly distinguish serial from concurrent WorkQueue
Jean-Yves Avenard [:jya]
Reported
2021-10-08 03:54:42 PDT
Currently we have a unique WorkQueue object, which can be configured at construction time to be either a concurrent or a serial one. A concurrent WorkQueue doesn't guarantee the order in which the queued tasks will run. That makes for a footgun if a consumer takes a WorkQueue and is expecting it to be a serial one. We should split the WorkQueue into a ConcurrentWorkQueue object, and make WorkQueue be a serial one.
Attachments
Patch
(46.08 KB, patch)
2021-10-09 00:48 PDT
,
Jean-Yves Avenard [:jya]
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(47.78 KB, patch)
2021-10-09 02:08 PDT
,
Jean-Yves Avenard [:jya]
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(47.82 KB, patch)
2021-10-09 02:40 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(47.95 KB, patch)
2021-10-09 05:08 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(47.96 KB, patch)
2021-10-09 05:47 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(49.57 KB, patch)
2021-10-12 00:58 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(49.44 KB, patch)
2021-10-12 16:04 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(49.33 KB, patch)
2021-10-13 15:20 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(48.06 KB, patch)
2021-10-13 15:46 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-10-08 03:55:03 PDT
<
rdar://problem/84021977
>
Jean-Yves Avenard [:jya]
Comment 2
2021-10-09 00:48:02 PDT
Created
attachment 440702
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 3
2021-10-09 02:08:22 PDT
Created
attachment 440705
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 4
2021-10-09 02:40:31 PDT
Created
attachment 440706
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 5
2021-10-09 05:08:16 PDT
Created
attachment 440708
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 6
2021-10-09 05:47:46 PDT
Created
attachment 440709
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 7
2021-10-12 00:58:28 PDT
Created
attachment 440905
[details]
Patch
Chris Dumez
Comment 8
2021-10-12 09:56:07 PDT
Comment on
attachment 440905
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=440905&action=review
EWS is red.
> Source/WTF/wtf/WorkQueue.h:59 > + enum class Type {
: bool
> Source/WTF/wtf/WorkQueue.h:63 > + static Ref<WorkQueueBase> create(const char* name, Type, QOS);
Why is this factory function still here? We shouldn't need it.
> Source/WTF/wtf/WorkQueue.h:87 > +class WorkQueue : public WorkQueueBase {
Should be marked as final.
> Source/WTF/wtf/WorkQueue.h:97 > +protected:
Why protected? Seems the constructor should be private. Are there any subclasses of WorkQueue?
> Source/WTF/wtf/WorkQueue.h:115 > +class ConcurrentWorkQueue : public WorkQueueBase {
final
Jean-Yves Avenard [:jya]
Comment 9
2021-10-12 14:39:47 PDT
Comment on
attachment 440905
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=440905&action=review
>> Source/WTF/wtf/WorkQueue.h:59 >> + enum class Type { > > : bool
when it's existing code like this being moved, I typically keep it as-is.
>> Source/WTF/wtf/WorkQueue.h:87 >> +class WorkQueue : public WorkQueueBase { > > Should be marked as final.
There's SuspendableWorkQueue ; this class and how the IOCache works is the primary reason I went with WebKitBase over the templated version we talked about. I believe it's WorkQueue people should be inheriting from rather than WorkQueueBase.
>> Source/WTF/wtf/WorkQueue.h:97 >> +protected: > > Why protected? Seems the constructor should be private. Are there any subclasses of WorkQueue?
yes SuspendableWorkQueue
Chris Dumez
Comment 10
2021-10-12 14:41:27 PDT
(In reply to Jean-Yves Avenard [:jya] from
comment #9
)
> Comment on
attachment 440905
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=440905&action=review
> > >> Source/WTF/wtf/WorkQueue.h:59 > >> + enum class Type { > > > > : bool > > when it's existing code like this being moved, I typically keep it as-is.
Not the WebKit policy though. In WebKit we clean up as we modify existing code since we rarely do pure clean up commits.
> > >> Source/WTF/wtf/WorkQueue.h:87 > >> +class WorkQueue : public WorkQueueBase { > > > > Should be marked as final. > > There's SuspendableWorkQueue ; this class and how the IOCache works is the > primary reason I went with WebKitBase over the templated version we talked > about. > > I believe it's WorkQueue people should be inheriting from rather than > WorkQueueBase. > > >> Source/WTF/wtf/WorkQueue.h:97 > >> +protected: > > > > Why protected? Seems the constructor should be private. Are there any subclasses of WorkQueue? > > yes SuspendableWorkQueue
Jean-Yves Avenard [:jya]
Comment 11
2021-10-12 16:04:56 PDT
Created
attachment 441010
[details]
Patch rebase, apply comments
Chris Dumez
Comment 12
2021-10-13 10:05:04 PDT
Comment on
attachment 441010
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441010&action=review
> Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannel.h:53 > + // For safety, it should use a serial WorkQueue (see
https://bugs.webkit.org/show_bug.cgi?id=231472
)
I still don't understand this comment and I don't think it is accurate. Cocoa uses a concurrent WorkQueue and the code is safe.
Jean-Yves Avenard [:jya]
Comment 13
2021-10-13 14:00:34 PDT
Comment on
attachment 441010
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441010&action=review
>> Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannel.h:53 >> + // For safety, it should use a serial WorkQueue (see
https://bugs.webkit.org/show_bug.cgi?id=231472
) > > I still don't understand this comment and I don't think it is accurate. Cocoa uses a concurrent WorkQueue and the code is safe.
Yes, this comment is incorrect. Forgot to remove it
Chris Dumez
Comment 14
2021-10-13 14:01:09 PDT
Comment on
attachment 441010
[details]
Patch Ok, r=me but please drop the comment.
Chris Dumez
Comment 15
2021-10-13 14:01:35 PDT
Comment on
attachment 441010
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=441010&action=review
> Source/JavaScriptCore/ChangeLog:11 > + Reviewed by NOBODY (OOPS!).
This is supposed to be above the description, not under.
> Source/WTF/ChangeLog:19 > + Reviewed by NOBODY (OOPS!).
This is supposed to be above the description, not under.
Jean-Yves Avenard [:jya]
Comment 16
2021-10-13 15:20:42 PDT
Created
attachment 441145
[details]
Patch
Jean-Yves Avenard [:jya]
Comment 17
2021-10-13 15:33:28 PDT
grrr another rebasing issue
Jean-Yves Avenard [:jya]
Comment 18
2021-10-13 15:46:58 PDT
Created
attachment 441151
[details]
Patch rebase
EWS
Comment 19
2021-10-13 17:09:25 PDT
Committed
r284135
(
242955@main
): <
https://commits.webkit.org/242955@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 441151
[details]
.
Yusuke Suzuki
Comment 20
2021-10-13 17:39:29 PDT
Committed
r284137
(
242957@main
): <
https://commits.webkit.org/242957@main
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug