can cef run in multi process or multi thread?

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.

can cef run in multi process or multi thread?

Postby thunk3 » Thu Oct 28, 2010 10:54 pm

hi, can cef run in multi process or multi thread? it mean one cef instance run in one thread, or one cef instance run in one process. if can, how to share the cookie and cache for every cef instance? thanks!
thunk3
Newbie
 
Posts: 2
Joined: Thu Oct 28, 2010 10:17 pm

Re: can cef run in multi process or multi thread?

Postby magreenblatt » Fri Oct 29, 2010 8:37 am

CEF has a single-process architecture. The CEF interface is thread safe except as otherwise noted for specific classes. All browser windows created in the same process will share state information. If you need state information shared across multiple processes you could potentially implement a single CEF process that creates browser windows whose parents are owned by various other processes. This would be similar in concept to the Chromium architecture described at http://www.chromium.org/developers/desi ... chitecture with CEF acting as the renderer process.

Regards,
Marshall
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: can cef run in multi process or multi thread?

Postby thunk3 » Thu Nov 04, 2010 3:57 am

thanks.
I find that:
bool CefInitialize(bool multi_threaded_message_loop,
const std::wstring& cache_path);
there is a param cache_path, one process call only once,
my question is , if create one CEF instance in a thread(there are many threads in my app), is multi-thread access cache(include cookie) safe?

thanks again :)
thunk3
Newbie
 
Posts: 2
Joined: Thu Oct 28, 2010 10:17 pm

Re: can cef run in multi process or multi thread?

Postby magreenblatt » Thu Nov 04, 2010 8:17 am

if create one CEF instance in a thread(there are many threads in my app), is multi-thread access cache(include cookie) safe?

All actions performed in all browser windows (rendering, loading JS, etc) are executed on a single thread. The CEF interface serializes calls to this thread as necessary. So, if you're using the existing CEF interfaces, everything is thread safe except as otherwise noted in the header files.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 77 guests