Custom CEF 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.

Custom CEF Thread?

Postby me12 » Fri Oct 31, 2014 7:11 am

Is there a way to create a custom thread and use CefPostTask() on it? If so, is there an example somewhere?
me12
Techie
 
Posts: 31
Joined: Thu Jul 10, 2014 12:46 pm

Re: Custom CEF Thread?

Postby magreenblatt » Fri Oct 31, 2014 11:16 am

What are you planning to do with the new thread?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Custom CEF Thread?

Postby me12 » Sun Nov 02, 2014 7:49 am

I have some heavy computation to do (in C++) once a user clicks some html element.

This is how I am doing it at the moment:

User clicks html element -> http request -> custom scheme handler -> redirect from IO to UI thread -> do computation there and return result in callback.

Since this computation can take a long time and blocks the UI thread meanwhile(no window paint event occurs in that time), I need to do it in another thread.

So here is what I want to do:

User clicks html element -> http request -> custom scheme handler -> redirect from IO to my custom thread -> do computation there and return result in callback.

My custom thread would be initialized when CEF starts and runs(waits) in the background for work to do.
me12
Techie
 
Posts: 31
Joined: Thu Jul 10, 2014 12:46 pm

Re: Custom CEF Thread?

Postby magreenblatt » Mon Nov 03, 2014 7:25 pm

Unfortunately CEF doesn't expose the ability to create new threads currently -- see https://code.google.com/p/chromiumembed ... ail?id=627. You can, however, use any number of existing libraries that support thread creation (for example, OS APIs or boost threads).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Custom CEF Thread?

Postby me12 » Wed Nov 05, 2014 9:47 am

magreenblatt wrote:You can, however, use any number of existing libraries that support thread creation (for example, OS APIs or boost threads).


Thanks! Thats how I am doing it now.
me12
Techie
 
Posts: 31
Joined: Thu Jul 10, 2014 12:46 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 95 guests