Bug 106713 - [WK2] Network process unblocks all waiting threads when any sync reply arrives
Summary: [WK2] Network process unblocks all waiting threads when any sync reply arrives
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-01-11 15:41 PST by Alexey Proskuryakov
Modified: 2013-01-11 16:10 PST (History)
3 users (show)

See Also:


Attachments
proposed patch (18.46 KB, patch)
2013-01-11 15:47 PST, Alexey Proskuryakov
beidson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2013-01-11 15:41:15 PST
BlockingResourceMap has a single ThreadCondition, and wakes up all waiting loader threads.

This does not have to be so inefficient.

<rdar://problem/12886430>
Comment 1 Alexey Proskuryakov 2013-01-11 15:47:31 PST
Created attachment 182437 [details]
proposed patch
Comment 2 Brady Eidson 2013-01-11 15:55:09 PST
Comment on attachment 182437 [details]
proposed patch

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

> Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp:190
> -    if (!send(Messages::WebResourceLoader::WillSendRequest(requestID, request, redirectResponse))) {
> +    if (!sendSync(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse), Messages::WebResourceLoader::WillSendRequest::Reply(request)))

If the premise is that it's okay to make this a sync message because it's *always* on a background thread, please ASSERT to that effect.

> Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp:288
> -    if (!send(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(requestID, protectionSpace)))
> +    bool result;
> +    if (!sendSync(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace), Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace::Reply(result)))

If the premise is that it's okay to make this a sync message because it's *always* on a background thread, please ASSERT to that effect.
Comment 3 Alexey Proskuryakov 2013-01-11 16:10:05 PST
Good point.

Committed <http://trac.webkit.org/r139516>.