Mir

Merge lp:~vanvugt/mir/override-ipc-threads into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Robert Carr
Approved revision: no longer in the source branch.
Merged at revision: 1110
Proposed branch: lp:~vanvugt/mir/override-ipc-threads
Merge into: lp:mir
Diff against target: 39 lines (+5/-2)
3 files modified
include/server/mir/default_server_configuration.h (+2/-0)
src/server/default_server_configuration.cpp (+1/-1)
src/server/frontend/default_configuration.cpp (+2/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/override-ipc-threads
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Carr (community) Approve
Alan Griffiths Abstain
Review via email: mp+188509@code.launchpad.net

This proposal supersedes a proposal from 2013-09-30.

Commit message

Allow the default thread pool size to be overridden. This is required
for the unity-system-compositor specific fix for LP: #1233001.

Also remove redundant option documentation which will soon get out of
sync and be wrong.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote : Posted in a previous version of this proposal

Another approach would be to change the ProgramOption class to be able to set the default value for each option independently of the get() method. u-s-c, or any other mir server, would then be able to set the default values to match its needs.

"Needs Discussion"

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal

I don't think this is the right way to support the overriding of option defaults.

As discussed elsewhere (e.g. bug 1226227) the strong coupling we have between DefaultServerConfiguration and the creation of the options object is wrong.

Clients should be free to implement the Option interface and supply it to DefaultServerConfiguration. This would allow then to both supply options via another mechanism or use different default values (which is the purpose here).

This MP makes the existing issues worse, not better. I'd prefer an approach that splits out the initialization of options and allows for the more general case. (And if we must address the specific case, a "virtual int default_ipc_threads()" method is clearer.)

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Less coupling...
Now allow the default number of IPC threads to be overridden in derived
ServerConfiguration constructors by simply assigning:
   default_ipc_threads = N;

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Ugly, but doesn't make bad things worse.

review: Abstain
Revision history for this message
Robert Carr (robertcarr) wrote :

Ok. Would be nice if it were int const though.

review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

This should be part of some ServerOptions interface which also encapsulates our current arguments/options and is passed to ServerConfiguration at construct time.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/server/mir/default_server_configuration.h'
2--- include/server/mir/default_server_configuration.h 2013-09-24 11:43:27 +0000
3+++ include/server/mir/default_server_configuration.h 2013-10-01 04:09:42 +0000
4@@ -301,6 +301,8 @@
5 CachedPtr<shell::MediatingDisplayChanger> mediating_display_changer;
6 CachedPtr<shell::BroadcastingSessionEventSink> broadcasting_session_event_sink;
7
8+ int default_ipc_threads = 10;
9+
10 private:
11 int const argc;
12 char const** const argv;
13
14=== modified file 'src/server/default_server_configuration.cpp'
15--- src/server/default_server_configuration.cpp 2013-09-24 17:25:47 +0000
16+++ src/server/default_server_configuration.cpp 2013-10-01 04:09:42 +0000
17@@ -289,7 +289,7 @@
18 "directory instead of the default logging directory."
19 " [string:default=\"\"]")
20 ("ipc-thread-pool", po::value<int>(),
21- "threads in frontend thread pool. [int:default=10]")
22+ "threads in frontend thread pool.")
23 ("vt", po::value<int>(),
24 "VT to run on or 0 to use current. [int:default=0]");
25 }
26
27=== modified file 'src/server/frontend/default_configuration.cpp'
28--- src/server/frontend/default_configuration.cpp 2013-09-25 14:18:18 +0000
29+++ src/server/frontend/default_configuration.cpp 2013-10-01 04:09:42 +0000
30@@ -51,7 +51,8 @@
31 return connector(
32 [&,this]() -> std::shared_ptr<mf::Connector>
33 {
34- auto const threads = the_options()->get("ipc-thread-pool", 10);
35+ auto const threads = the_options()->get("ipc-thread-pool",
36+ default_ipc_threads);
37 auto shell_sessions = the_shell_session_container();
38 auto const& force_requests_to_complete = [shell_sessions]
39 {

Subscribers

People subscribed via source and target branches