Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Issue 6966030: Allow multiple ChildProcess objects in one process for the --single-process case, when we have bo... (Closed)

Created:
9 years, 7 months ago by jam
Modified:
9 years, 6 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Allow multiple ChildProcess objects in one process for the --single-process case, when we have both renderer and gpu. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=87712

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -13 lines) Patch
M content/common/child_process.h View 2 chunks +1 line, -4 lines 0 comments Download
M content/common/child_process.cc View 5 chunks +16 lines, -9 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
jam
9 years, 7 months ago (2011-05-24 06:18:52 UTC) #1
apatrick_chromium
LGTM
9 years, 7 months ago (2011-05-24 17:51:08 UTC) #2
Daniel Sievers (Google)
Won't this break things somewhere, because now retrieving ChildProcess::current() will only work from the same ...
9 years, 7 months ago (2011-05-24 18:24:30 UTC) #3
jam
On 2011/05/24 18:24:30, Daniel Sievers wrote: > Won't this break things somewhere, because now retrieving ...
9 years, 7 months ago (2011-05-24 19:10:29 UTC) #4
Daniel Sievers (Google)
Ok, having two ChildProcess instances and two io threads sounds fine then (one for gpu ...
9 years, 7 months ago (2011-05-24 20:16:39 UTC) #5
jam
On 2011/05/24 20:16:39, Daniel Sievers wrote: > Ok, having two ChildProcess instances and two io ...
9 years, 7 months ago (2011-05-24 21:17:41 UTC) #6
jam
On Tue, May 24, 2011 at 1:16 PM, <sievers@google.com> wrote: > > Ok, having two ...
9 years, 7 months ago (2011-05-24 21:45:15 UTC) #7
Daniel Sievers (Google)
On 2011/05/24 21:45:15, John Abd-El-Malek wrote: > On Tue, May 24, 2011 at 1:16 PM, ...
9 years, 7 months ago (2011-05-25 20:33:41 UTC) #8
jam
9 years, 7 months ago (2011-05-25 20:59:51 UTC) #9
On Wed, May 25, 2011 at 1:33 PM, <sievers@google.com> wrote:

> On 2011/05/24 21:45:15, John Abd-El-Malek wrote:
>
>  On Tue, May 24, 2011 at 1:16 PM, <mailto:sievers@google.com> wrote:
>>
>
>  >
>> > Ok, having two ChildProcess instances and two io threads sounds fine
>> then
>> > (one
>> > for gpu one for renderer) in single process mode.
>> >
>> > But I'm not convinced that ChildProcess objects shouldn't be able to
>> have
>> > thread-safe methods. In fact, how do we know there isn't even existing
>> code
>> > that
>> > calls ChildProcess::current() from different threads?
>> >
>> > If we want to allow multiple ChildProcess instances in one process, then
>> we
>> > should rather deprecate ChildProcess::current() and require explicit
>> calls
>> > to
>> > RenderProcess::current() or GpuProcess::current() instead, which each
>> have
>> > their
>> > own static instance.
>>
>
>
>  btw, I'm fine with doing this.  however in order to do that, we'd need to
>> get rid of the existing ChildProcess::current calls.  that probably won't
>> be
>> a huge task.
>>
>
>
>
>
> I agree that it is a bit ugly though in the way the static interface is
> currently exposed. For example, it's odd that you cannot reach
> ChildThread::current() from the wrong thread anymore (it returns null),
> while
> you can still do ChildProcess::main_thread() from anywhere.
>

Once ChildThread::current uses the TLS, then no need to expose main_thread()
anymore from ChildProcess.


>
> So maybe if we end up touching all the code that calls
> ChildProcess::current(),
> it might be worth changing the class to only expose static interfaces for
> threadsafe and useful functions (such as posting a task to some thread),
> rather
> than exposing the *whole* class interface as a static member.


This isn't a pattern that we usually do, so I'm wary of doing that.

>
>
>
>  >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > http://codereview.chromium.org/6966030/
>> >
>>
>
>
>
> http://codereview.chromium.org/6966030/
>

Powered by Google App Engine
This is Rietveld 408576698