Bug 147841 - Convert all locking and condition variables in WebKit to use fast ParkingLot-based locks and condition variables
Summary: Convert all locking and condition variables in WebKit to use fast ParkingLot-...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 147665 147908 147986 148089 148140 148493
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-10 14:03 PDT by Filip Pizlo
Modified: 2015-08-26 19:14 PDT (History)
13 users (show)

See Also:


Attachments
ParkingLot-based Condition (13.83 KB, patch)
2015-08-13 00:29 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (27.07 KB, patch)
2015-08-13 12:09 PDT, Filip Pizlo
mark.lam: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-08-10 14:03:01 PDT
The grand plan is:

- Make Lock use atomic increments on the fast path and ParkingLot on the slow path.  This will make the fast path a lot better and will reduce the memory usage of Lock.

- Give Lock and ByteLock the ability to act as their own condition variables.

- Create a separate Condition that uses one byte and some ParkingLot magic, for those cases where a separate condition variable is needed.

Then we can remove all uses of std::mutex, std::condition_variable, WTF::Mutex, and WTF::ThreadCondition.
Comment 1 Filip Pizlo 2015-08-13 00:29:40 PDT
Created attachment 258884 [details]
ParkingLot-based Condition
Comment 2 Filip Pizlo 2015-08-13 12:09:25 PDT
Created attachment 258912 [details]
the patch

This patch is good to go assuming we want to land this separately from the patch that replaces all uses of ThreadCondition/std::condition_variable with this.
Comment 3 WebKit Commit Bot 2015-08-13 12:11:05 PDT
Attachment 258912 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/ParkingLot.cpp:561:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:68:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:83:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:91:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:115:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Tools/TestWebKitAPI/Tests/WTF/Condition.cpp:122:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 6 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Mark Lam 2015-08-13 12:19:23 PDT
Comment on attachment 258912 [details]
the patch

Missing the ChangeLog.
Comment 5 Filip Pizlo 2015-08-13 12:49:07 PDT
Comment on attachment 258912 [details]
the patch

I will submit this patch to a different bug.
Comment 6 Filip Pizlo 2015-08-19 11:19:59 PDT
OK, I think this is done.