diff --git a/src/backend/thread-wrapper.hpp b/src/backend/thread-wrapper.hpp index 12c7fa475..835321ccc 100644 --- a/src/backend/thread-wrapper.hpp +++ b/src/backend/thread-wrapper.hpp @@ -218,6 +218,7 @@ namespace backend { static void syncPoint () { + ////////////////////////////////////////////////////////TICKET #1054 : consider to call safeguard here, to ensure this is called from within the thread lumiera_thread_sync (); } }; diff --git a/src/proc/control/proc-dispatcher.cpp b/src/proc/control/proc-dispatcher.cpp index 3c1ceeddb..f2ed6fac9 100644 --- a/src/proc/control/proc-dispatcher.cpp +++ b/src/proc/control/proc-dispatcher.cpp @@ -23,10 +23,26 @@ /** @file proc-dispatcher.cpp ** Implementation details of running commands and the builder. - ** The ProcDispatcher is at the heart of the session subsystem and implements - ** a (single) session thread to perform commands and trigger builder runs. - ** New commands can be enqueued with a dedicated CommandQueue, while the details - ** of operation control logic are encapsulated in a [logic component](\ref Looper). + ** The ProcDispatcher is at the heart of the session subsystem and implements a + ** (single) session thread to perform commands and trigger builder runs. New commands + ** can be enqueued with a dedicated CommandQueue, while the details of operation control + ** logic are encapsulated in a [logic component](\ref Looper). + ** + ** # Operational Semantics + ** We need to distinguish between the ProcDispatcher itself, which is a static (singleton) service, + ** and the »Session Subsystem« plus the _Session proper._ The subsystem has an application-global lifecycle, + ** while the Session itself is a data structure and can be closed, opened or re-loaded. There is a singular + ** transactional access point to the Session datastructure, which can be switched to new session contents. + ** But external manipulation of the session contents is performed by commands, which are _dispatched_ -- + ** to manage this process is the concern of the »Session Subsystem«. + ** + ** Closing a session blocks further command processing, while the lifecycle of the _Session Subsystem_ is + ** actually linked to _running the \ref DispatcherLoop_ -- implementation logic defined in this translation + ** unit here. This loop implementation is performed in a dedicated thread, _the Session Loop Thread._ And + ** this also entails opening the public SessionCommandService interface. + ** + ** ## Loop operation control + ** ** ** @todo as of 12/2016, implementation has been drafted and is very much WIP ** @todo //////////////////////////////////////////////////////TODO ensure really every state change triggers a wakeup!!!!!!! @@ -66,8 +82,8 @@ namespace control { , public Sync { bool canDispatch_{false}; - bool blocked_ {false}; - + + /** manage the primary public Session interface */ unique_ptr commandService_; CommandQueue queue_; @@ -78,7 +94,7 @@ namespace control { DispatcherLoop (Subsys::SigTerm notification) : ThreadJoinable("Lumiera Session" , bind (&DispatcherLoop::runSessionThread, this, notification)) - , commandService_(new SessionCommandService(*this)) + , commandService_{new SessionCommandService(*this)} , queue_() , looper_([&]() -> bool { @@ -93,7 +109,7 @@ namespace control { { try { Lock sync(this); - commandService_.reset(); // redundant call, ensure the session interface is reliably closed + commandService_.reset(); // redundant call, to ensure session interface is closed reliably this->join(); // block until the loop thread terminates and is reaped INFO (session, "Proc-Dispatcher stopped."); } diff --git a/src/proc/control/proc-dispatcher.hpp b/src/proc/control/proc-dispatcher.hpp index b97e3046e..dd57fb48f 100644 --- a/src/proc/control/proc-dispatcher.hpp +++ b/src/proc/control/proc-dispatcher.hpp @@ -35,22 +35,18 @@ #ifndef PROC_CONTROL_PROC_DISPATCHER_H #define PROC_CONTROL_PROC_DISPATCHER_H -//#include "lib/symbol.hpp" #include "common/subsys.hpp" #include "lib/depend.hpp" #include "lib/sync.hpp" #include -//#include namespace proc { namespace control { -// using lib::Symbol; using std::unique_ptr; -// using std::bind; using lumiera::Subsys; @@ -79,14 +75,9 @@ namespace control { void awaitDeactivation(); void clear(); - - /* == diagnostics == */ - -// size_t size() const ; bool empty() const ; }; - ////////////////TODO currently just fleshing out the API.... diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 53a0252a9..f4dcb6ecd 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -140,6 +140,7 @@ namespace session { void getSessionReady() override { + /////////////////////////////////////////////TODO anything to do here? INFO (session, "Session ready for use."); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 6437a5c76..d993c528e 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -11016,7 +11016,7 @@ - + @@ -11042,7 +11042,7 @@ - + @@ -11188,7 +11188,14 @@ - + + + + + + + + @@ -11287,7 +11294,7 @@ - + @@ -11321,7 +11328,7 @@ - + @@ -11333,6 +11340,13 @@ + + + + + + + @@ -11400,12 +11414,6 @@ - - - - - -