Limit/configure concurrent CefStreamReader threads

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Limit/configure concurrent CefStreamReader threads

Postby arsnyder16 » Mon Aug 17, 2020 4:49 pm

I recently upgraded to CEF to 80.1.4. I have been struggling with the changes to the threading model that handles custom CefStreamReader returned by my CefSchemeHandlerFactory. In previous versions i could use `bool MayBlock() override { return true; }` for my expensive requests to end up on dedicate thread i think it was called FileThread of some sort, then for any request the passed false would be handled on the IO thread. The problem i have is in some instances i have to call into some native code that is not thread safe and won't be in the near future. I have solved some of these issues previous with a std::mutex, but in some cases i am doing some off screen rendering with directx and windows device contexts for some data visualizations. With DCs they can only be accessed by the creating thread. There is a relatively large expense to initial this code so previously i could cache most of it making subsequent requests very fast since its was only ever on the "FileThead". The new networking model of chromium has a pool of threads that handle requests. So when i have a large number of concurrent requests i can get up to 16 threads that need initialized which is very noticeable in my render times compared to previous time, to make matters worse after a period of time those threads are destroyed the process starts all over again. I understand my cases are sort of unique and overall multiple requests is certainly better.

At this point i probably need to introduce my own dedicated thread to handle the rendering process.
I am curious if there any other options?
It would be nice if i could configure CEF or chromium in some way either to give a min/max threads
Possibly set the thresholds for when threads are destroyed.
Maybe configuring specific CefSchemeHandlerFactory to have their own threading model or pool.
arsnyder16
Newbie
 
Posts: 1
Joined: Wed Apr 08, 2020 3:14 pm

Return to Support Forum

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 28 guests