Bug 43150 - Investigate using the thread pool instead of a dedicated thread for WorkQueue on Windows
Summary: Investigate using the thread pool instead of a dedicated thread for WorkQueue...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks: 42826
  Show dependency treegraph
 
Reported: 2010-07-28 14:51 PDT by Adam Roben (:aroben)
Modified: 2010-09-01 00:03 PDT (History)
5 users (show)

See Also:


Attachments
Use the Windows thread pool instead of a dedicated thread for WorkQueue on Windows (13.97 KB, patch)
2010-08-27 09:25 PDT, Adam Roben (:aroben)
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2010-07-28 14:51:29 PDT
We should investigate using the Windows thread pool [1] instead of a dedicated thread for WorkQueue on Windows. This would be more similar to how WorkQueue works on Mac, and would hopefully improve performance overall. We'd probably implement this by using ::RegisterWaitForSingleObject.

1. http://msdn.microsoft.com/en-us/library/ms686756(v=VS.85).aspx
Comment 1 Adam Roben (:aroben) 2010-07-28 14:52:20 PDT
<rdar://problem/8247280>
Comment 2 Adam Roben (:aroben) 2010-08-05 09:35:05 PDT
We probably wouldn't want to do this until we had switched to using an I/O completion port in WorkQueue (bug 43148).

But I'm not so sure this will work well for us, at least not with ::RegisterWaitForSingleObject. That function will cause a new worker thread to be spawned every time the I/O completion port is signaled, even if another thread is already processing a message from the completion port. This is OK for correctness, as the worker thread will then immediately block on ::GetQueuedCompletionStatus until the other thread(s) finish their work. But it could mean that lots of threads end up sitting around blocked on ::GetQueuedCompletionStatus if it takes longer for a message to be processed than it takes for the completion port to get signaled again.
Comment 3 Adam Roben (:aroben) 2010-08-27 09:25:50 PDT
Created attachment 65721 [details]
Use the Windows thread pool instead of a dedicated thread for WorkQueue on Windows
Comment 4 Anders Carlsson 2010-08-29 14:45:07 PDT
Comment on attachment 65721 [details]
Use the Windows thread pool instead of a dedicated thread for WorkQueue on Windows

r+
Comment 5 Adam Roben (:aroben) 2010-08-31 10:59:13 PDT
Committed r66506: <http://trac.webkit.org/changeset/66506>