Commit graph

4724 commits

Author SHA1 Message Date
b6d5cd1c76 SessionCommandService implemented by delegating to the ProcDispatcher 2016-12-23 23:42:27 +01:00
b3f0605b9b SessionCommand-facade: consider how to expose command invocation
after reading some related code, I am leaning towards a design
to mirror the way command messages are sent over the UI-Bus.

Unfortunately this pretty much abandons the possibility to
invoke these operations from a client written in C or any
other hand made language binding. Which pretty much confirms
my initial reservation towards such an excessively open
and generic interface system.
2016-12-23 07:26:00 +01:00
386c15f039 obviously a better name
...since it became customary to have make_tuple, make_shared, make_unique
2016-12-23 04:24:22 +01:00
1a4b6545a0 maximum munch
...feels like X-mas
2016-12-23 04:23:03 +01:00
39060297ee ProcDispatcher: solve the sync waiting for a "checkpoint"
...based on the logic of the whole loop
2016-12-22 21:36:03 +01:00
8bbc0fb97f more clean-up and comments 2016-12-22 19:35:42 +01:00
ad6a2ef090 ProcDispatcher: fix possible race at startup 2016-12-22 18:42:12 +01:00
0d436deb9e clean-up and comments for the implementation finished thus far 2016-12-22 04:04:41 +01:00
99b9af0a74 Looper: loop control logic unit test PASS 2016-12-22 03:28:41 +01:00
96def6b1ba Looper: elaborate implementation
looks doable indeed...
2016-12-22 03:12:14 +01:00
196696a8d0 Looper: draft possible implementation
seemingly a quite simple "trap door" mechanism is sufficient
2016-12-21 03:56:56 +01:00
ef6ecf3dd0 Looper: rework the spec for the builder triggereing behaviour
...still don't know how to implement it, but now it is at least
specified more correct, with respect to the implementation of the loop
2016-12-21 03:15:36 +01:00
6073df3554 Looper: other (better?) idea how to handle "builder dirty" automatically
...this means to turn Looper into a state machine.
Yet it seems more feasible, since the DispatcherLoop has a nice
checkpoint after each iteration through the while loop, and we'd
keep that whole builder-dirty business completely confined within
the Looper (with a little help of the DispatcherLoop)

Let's see if the state transition logic can actually be implemented
based just on such a checkpoint....?
2016-12-20 03:53:48 +01:00
14e0d65468 Looper: idea how to determine "builder dirty"
...just by offloading that task onto the CommandQueue,
which happens to know when a new command is being scheduled
2016-12-20 03:18:03 +01:00
bae3d4b96f mark a solution how to create a safeguard against deadlock on session shutdown
....if by some weird coincidence, a command dispatched into the session
happens to trigger session shutdown or re-loading, this will cause a deadlock,
since decommissioning of session data structures must wait for the
ProcDispatcher to disable command processing -- and this will obviously
never happen when in a callstack below some command execution!
2016-12-20 02:35:45 +01:00
746866f5fc Looper: draft requirements on logic for triggering the builder 2016-12-16 23:56:53 +01:00
b873f7025b ProcDispatcher: mark some next tasks to care for 2016-12-16 23:26:56 +01:00
53ed0e9aa3 ProcDispatcher: consider and document the fine points of operational semantics
there are some pitfalls related to timing and state,
especially since some state changes are triggered, but not immediately reached
2016-12-16 23:11:19 +01:00
8ee08905b3 Looper: extend test coverage 2016-12-16 20:38:00 +01:00
30254da95f Looper: implement core operation control logic 2016-12-16 19:21:06 +01:00
9c9e75ee01 Looper: define testcase regarding activity control 2016-12-16 18:40:29 +01:00
af92ed505b Looper: implementation 2016-12-16 18:34:04 +01:00
be97473779 Looper: define first basic testcase 2016-12-16 18:23:46 +01:00
5fd65d6613 Looper: test setup 2016-12-16 18:09:51 +01:00
7b860947b1 ProcDispatcher: skeleton of the processing loop
including a draft of the Looper control component and the
invocation of the object monitor for waiting on condition var
2016-12-15 22:15:20 +01:00
00077d0431 ProcDispatcher: decide on requirements and implementation structure (#1049) 2016-12-15 20:48:35 +01:00
7e65dda771 draft request to halt the dispatcher loop 2016-12-15 06:21:59 +01:00
86f446c197 better control of the shutdown sequence
holding the SessionCommandService in a unique_ptr allows us to
close the Interface reliably *before* the Loop is halted.
2016-12-15 05:54:48 +01:00
a3c22b8aff SessionCommandService to be operated by the DispatcherLoop 2016-12-15 05:38:12 +01:00
715d3d2890 fix indentation 2016-12-15 05:31:56 +01:00
4d45dfd4be introduce CommandDispatch interface
this allows to let the DispatcherLoop actually serve
as implementation facility for the SessionCommandService
2016-12-15 05:21:03 +01:00
1ec883787a DOC: decision about where to home the SessionCommandService
After some consideration, it became clear that this service implementation
is closely tied to the DispatcherLoop -- which will consequently be
responsible to run and expose this service implementation
2016-12-15 05:07:40 +01:00
eb73242113 document decisions regarding session subsystem components and lifecycle
* "session subsystem" == running the ProcDispatcher
* session itself is pulled up on demand by the SessionManager
2016-12-14 05:10:51 +01:00
479f4170c2 implement activated state
need to keep state variables on both levels,
since the session manager (lifecycle) "opens" the session
for external access by starting the dispatcher; it may well happen
thus that the session starts up, while the *session subsystem*
is not(yet) started
2016-12-14 04:57:08 +01:00
a853851447 add complete locking to the ProcDispatcher
on both levels
- the front-end needs locking to ensure consistent state (memory barrier)
- the back-end nees locking to coordinate command processing
2016-12-14 04:18:58 +01:00
4c30c349aa change the way command dispatching is controlled by the session
"command dispatching" == the public session interface
so we'll better implement this important causal link directly,
instead of some obscure trickery with lifecycle events.
2016-12-14 03:59:13 +01:00
8b354ab721 consider and rectify session lifecycle
turns out that I've created a race and consistency problem
just by a silly idiotic fixation on performance. Never ever
leave out a lock to "improve" performance, mind me.
2016-12-14 03:48:30 +01:00
8da9858056 draft skeleton of the dispatcher loop thread 2016-12-13 04:45:00 +01:00
1a8408afb5 rework ProcDispatcher to run dispatcher thread as PImpl
note the idea is to have a joinable thread, where deleting
the enclosing object blocks until the thread is finished
2016-12-13 04:34:28 +01:00
08e426047b define session subsystem lifefycle (#318)
...by forwarding over the static interface to the ProcDispatcher
2016-12-13 04:32:37 +01:00
014a828c63 next task: implement minimal "Session subsystem" (#318)
mark TODOs in code to make that happen.
Actually, it is not hard to do so, it just requires to combine
all the existing building blocks. When this is done, we can define
the "Session" subsystem as prerequisite for "GUI" in main.cpp

Unless I've made some (copy-n-paste) mistake with defining the facades,
this should be sufficient to pull up "the Session" and automatically
let the Gui-Plugin connect against the SessionCommandService
2016-12-12 03:45:21 +01:00
c144d15e65 add two placeholder functions for now
...soon to be replaced by the actual stuff, but right now
I am only concerned with getting all the boilerplate straight
2016-12-12 03:16:29 +01:00
4975712b5e copy-n-paste-programming to define SessionCommand interface / service
...the sheer amount of mechanical replacements scattered all over these
files might be a vivid indication, that the design of the interface system
is subobptimal ;-)
2016-12-12 03:09:08 +01:00
64e303999e WIP: start definition of SessionCommand interface 2016-12-12 02:55:32 +01:00
a51c9b9a63 clean-up: rename header to reflect interface name 2016-12-12 02:10:52 +01:00
b6e7caf737 Guistart(#1045): relocate opening of GuiNotification into the CoreServices
up to now this happened from the GuiRunner, which was a rather bad idea
- it can throw and thus interfer with the startup process
- the GuiNotification can not sensibly be *implemented* just backed
  by the GuiRunner. While CoreService offers access to the necessary
  implementation facilities to do so
2016-12-12 01:49:11 +01:00
5e9b3be985 better name for the interface function actually to launch the UI 2016-12-12 01:46:03 +01:00
4fc1126a28 clean-up: mark subsystem implementations with noexcept and override
throw() is deprecated
noexcept behaves similar, but allows for optimisations and will be
promoted to a part of the signature type in C++17
2016-12-12 01:18:19 +01:00
79800bb6eb workaround for shutdown problems due to circular UI-Bus topology
so the true reason is an inner contradiction in the design
- I want it to be completely self similar
- but the connection to CoreService does not conform
- and I do not want to hard code CoreService into the Nexus classdefinition

So we treat CoreService as uplink für Nexus and Nexus as uplink for CoreService,
with the obvious consequences that we're f**ed at init and shutdown.

And since I want to retain the overall design, I resort to implement
a short circuit detector, which suppresses circular deregistration calls
2016-12-11 01:34:32 +01:00
e75152b29d install and activate UI-Bus in the actual GUI (#1043)
Decision was made to use the CoreService as PImpl to organise
all those technical aspects of running the backbone. Thus,
the Nexus (UI-Bus hub) becomes part of CoreService
2016-12-10 04:01:06 +01:00