[Webkit-unassigned] [Bug 187984] [Curl] Use shared single thread for WebSocket connections

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 4 11:10:26 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=187984

--- Comment #23 from Basuke Suzuki <Basuke.Suzuki at sony.com> ---
Comment on attachment 389232
  --> https://bugs.webkit.org/attachment.cgi?id=389232
Handling connections by one thread.

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

>>>>> Source/WebCore/platform/network/curl/CurlStreamScheduler.cpp:48
>>>>> +    m_nextStreamID = (m_nextStreamID + 1 != invalidCurlStreamID) ? m_nextStreamID + 1 : 1;
>>>> 
>>>> You don't check m_nextStreamID is not used.
>>>> Can you use the pointer of client instead of m_nextStreamID?
>>> 
>>> The timing of issuing ID and object allocation is different. We cannot simply use the address as an id. Also memory region can be reused for same object type and it is safe not to use address. But existence check is required.
>> 
>> Fixed not to use in-use IDs.
>> As stand in comment11 we cannot substitute IDs by pointers.
> 
> I don't agree on this. SocketStreamHandleImpl always lives longer than CurlStream.
> Even if CurlStream would be alive longer than SocketStreamHandleImpl, I think using WeakPtr is better because HashMap is expensive.

No, he's talking about the timing difference between issuing ID and object instantiation. ID has to be issued at the timing of CurlStreamScheduler::create() and CurStream object will be created in the worker thread. That's the design of this patch. 

As of WeakPtr, it has to be created in main thread and that's also the approach we cannot take.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200204/2a461648/attachment-0001.htm>


More information about the webkit-unassigned mailing list