Hi Brett,

On Tue, Nov 18, 2008 at 11:12 AM, Brett Wilson <[EMAIL PROTECTED]> wrote:

>
> On Tue, Nov 18, 2008 at 7:14 AM, Marshall Greenblatt
> <[EMAIL PROTECTED]> wrote:
> > Hi Brett,
> >
> > On Tue, Nov 18, 2008 at 9:56 AM, Brett Wilson <[EMAIL PROTECTED]>
> wrote:
> >>
> >> On Tue, Nov 18, 2008 at 6:50 AM, Marshall Greenblatt
> >> <[EMAIL PROTECTED]> wrote:
> >> > Hi All,
> >> >
> >> > Is it safe to create (via Browser::Create*()) and/or access Browser
> >> > object
> >> > instances from multiple threads?  In other words, I need to choose one
> >> > of
> >> > the following options:
> >>
> >> No, the entire UI of Chrome is single-threaded and is not threadsafe.
> >> If you need things to access it from multiple threads, you will need
> >> to synchronize everything.
> >
> > Is there a thread-safe method equivalent to the PostMessage() WinAPI call
> > for adding events to the browser MessageLoop?
>
> PostMessage should already be thread safe.


Thanks for your input, I think I understand now.  Both the Windows message
loop and the chrome task queue co-exist in the MessageLoop class via
Delegate and Dispatcher implementations.  Chrome uses the Windows message
loop as a means for managing the task queue (via WM_TIMER calls), so there
should be no need for me to post Windows messages directly to the UI
thread.  Instead, to call a Browser object method (like GoBack()) from a
separate thread I should execute MessageLoopForUI::current()->PostTask()
(which is itself thread-safe) to have the UI thread execute a method that I
provide, which would in turn make the Browser method call.

I also found this document helpful in understanding the message system:
http://dev.chromium.org/developers/design-documents/threading


>
>
> Brett


Thanks,
Marshall


>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-dev" group.
To post to this group, send email to chromium-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/chromium-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to