WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
50381
nrwt multiprocessing - add in actual multiprocessing code
https://bugs.webkit.org/show_bug.cgi?id=50381
Summary
nrwt multiprocessing - add in actual multiprocessing code
Dirk Pranke
Reported
2010-12-02 02:45:25 PST
nrwt multiprocessing - add in actual multiprocessing code
Attachments
Patch
(9.16 KB, patch)
2010-12-02 02:48 PST
,
Dirk Pranke
no flags
Details
Formatted Diff
Diff
ignore - wrong bug
(85.89 KB, patch)
2010-12-02 03:00 PST
,
Dirk Pranke
no flags
Details
Formatted Diff
Diff
update w/ new interfaces, aggregation code
(5.03 KB, patch)
2010-12-06 05:36 PST
,
Dirk Pranke
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Dirk Pranke
Comment 1
2010-12-02 02:48:07 PST
Created
attachment 75362
[details]
Patch
Dirk Pranke
Comment 2
2010-12-02 02:54:48 PST
***
Bug 49567
has been marked as a duplicate of this bug. ***
Dirk Pranke
Comment 3
2010-12-02 03:00:24 PST
Created
attachment 75363
[details]
ignore - wrong bug
Dirk Pranke
Comment 4
2010-12-02 03:01:12 PST
Comment on
attachment 75362
[details]
Patch whoops ... wrong bug
Eric Seidel (no email)
Comment 5
2010-12-02 09:24:55 PST
Comment on
attachment 75362
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=75362&action=review
Other than the super() call, I think this is OK.
> WebKitTools/Scripts/webkitpy/layout_tests/layout_package/message_broker.py:370 > + super(_MultiProcessBroker._Worker, self).__init__(broker,
Interesting. I was just reading this:
http://fuhm.net/super-harmful/
I'm not sure super() is what we want in this MI setting.
Eric Seidel (no email)
Comment 6
2010-12-02 09:25:35 PST
Comment on
attachment 75362
[details]
Patch r- since that constructor isn't probably doing what you want (it's only causing one of the parent classes to be __init__'d too... which may or may not matter.
Dirk Pranke
Comment 7
2010-12-02 12:15:25 PST
(In reply to
comment #6
)
> (From update of
attachment 75362
[details]
) > r- since that constructor isn't probably doing what you want (it's only causing one of the parent classes to be __init__'d too... which may or may not matter.
super(_MultiProcessBroker._Worker, self) == dump_render_tree_thread.Worker.__init__() That code does: super(dump_render_tree_thread.Worker, self) == multiprocessing.Process.__init() So it works fine, and, in my admittedly somewhat shaky understanding of MI in Python, is how this code has to be written for drt_thread.Worker to know how to call the correct next method in the MRO. From threads on the Google internal python-users@ list, Guide mentioned that the post you linked to is dated and somewhat misleading. I asked for a recommendation on the best way to do what I'm trying to do here, but have yet to get a reply. There are two possible other options that I can think of. 1) have MultiProcessBroker._Worker init both subclasses (and not use super). drt_thread.Worker only initialize itself and not call anything else (making it more like a mixin or a trait). 2) use delegation or aggregation instead of inheritance in the first place. This is the way I originally did this, but it was clunky and the naming was awkward. That said, it's also a bit more testable, depending on how it's coded, because I could make drt_thread.Worker a parameter that gets passed in, and which would remove the dependency on dump_render_tree_thread. What do you think?
Dirk Pranke
Comment 8
2010-12-06 05:36:13 PST
Created
attachment 75682
[details]
update w/ new interfaces, aggregation code
Dirk Pranke
Comment 9
2010-12-06 05:38:14 PST
Please review again. This code uses the new aggregation-style interfaces I've added in 50557. There's a bunch of code duplication here that would go away if we decided to allow multiple inheritance. However, if we allow it here and didn't allow it in the first patches for 50375 (the ones that didn't use aggregation), we should probably document why it was okay in one place and not okay in another somewhere.
Eric Seidel (no email)
Comment 10
2010-12-06 11:55:03 PST
Since when do we not allow multiple inheritance? We use it all over the tool/commands/ directory. :)
Tony Chang
Comment 11
2010-12-06 11:59:12 PST
(In reply to
comment #10
)
> Since when do we not allow multiple inheritance? We use it all over the tool/commands/ directory. :)
MI is fine for mixins, but that's not what Dirk's talking about here.
Dirk Pranke
Comment 12
2010-12-06 12:06:56 PST
(In reply to
comment #11
)
> (In reply to
comment #10
) > > Since when do we not allow multiple inheritance? We use it all over the tool/commands/ directory. :) > > MI is fine for mixins, but that's not what Dirk's talking about here.
Yeah, I meant not allow as in "R- its use in this patch", not banning multiple inheritance generally. However, given that, for example, your comment in #4 about super not being the thing to use was wrong AFAICT, and that it took me a bunch of research to figure out what the "right" way to do MI in this setting was prior to that, banning some uses doesn't seem like a completely bad idea.
Dirk Pranke
Comment 13
2010-12-14 20:52:01 PST
marking as WONTFIX. will split up the patches differently.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug