Hi there long time not showing meself here :-)
I have a very big and difficult question - and not expecting any real answers - but I am trying here because after googled all the way about my question, here I am and I will try other forums or very specialized free support discutions website....
First of all, I put which env I am writting my project, and I already asked similar question.
Language: C++ ( and some external C libs ):
Text-console-mode using ncurses
External libraries: pthread, sigc++-2.0, ncurses and maybe dl ( dlopen stuff )
Thus, I am writting a C++ User-interface framework using the above stuff.
But one thing is really stopping me in the design: The events propagation design model in the
multi-thread env, and the problem of propagation of any events into the object hierarchies in the application framework.
I've already made a failed test: see [URL=http://ncdk.sf.net]ncdk
And read the API DOCS for the sources and the object-tree model. It is not the object-tree but the infamous events-propagation model.
Starting with a events simple design in single thread env:
Code:
[ Application central get-events loop ]
| |
| [KEY, MOUSE, SIGNALetc... events ]
| | <<== classify event
| [Propagate event trhough Active widget/object child-to-parent]
| | << or
| [Propagate event through registered objects ]
| |
\\< -------[dead-end of the "unconsumed" event propagation]
Thus not too difficult to implement that design as I did in the past in MS-DOS.
But in a multi-threaded environment, it is NOT feasible that way.
Any object/widget can be created and living in a different thread and must recieve as well the key,mouse, signals events from the application's central loop... And can trigger own events to be propagated from the central application getevent loop :-)
So
mutex/waitcond/lock-unlock (non recursive tho ) must be placed at the strategic and sensible points and not be recursive into its self-thread...
I tried to get and read the so X11 sources but no clue where to start --- my brain was melting just trying to find a startpoint about events propagation!
KDE/QT are just sitting above the X11 technology --- can't get any clue there.
Any "GOD"-programmer kind enough to help me ? ( hints, advices,guidelines, URLs)
Thanks
Bretzel