From: Dave (dfisher_at_pophost.com)
Date: 2002-04-02 17:26:22
On Tue, 2 Apr 2002 23:32:38 +1000, John Morrison wrote:
><<<< This was written today before Jim Posted his reply but I didn't want to
>wast all that typing >>>>
><<<< Wrote this on my 2 hours train travel to work.......
2 hours?! Wow... that is one long commute.
> The original “1 thread” proposed has the major disadvantage that if any
>component gets into an endless loop or in some way locks up whole program
>stops. So I think we should have a thread for the user interaction so that
>if something does lockup at least the user can click “Exit”. Also there
>WILL be ”User interface” modules that require constant updates even when
>there is no real data. Eg MP3 player, animations, Setting up and closing
>down the network.
I know that Jim-P mentioned that the first conception of a node-network was
assuming one thread, but, I think, he meant this relative only for the network
-- not for the application as a whole. Thus, the Device would have its own
thread, other UI components will have theirs, and so forth, as you mention
above.
> ModuleA.outputNode(referance to Node1)
> ModuleB.outputNode(referance to Node2)
> ModuleC.outputNode(referance to Node3)
>
> ModuleB.addInputNode(referance to Node1)
> ModuleC.addInputNode(referance to Node1)
> ModuleC.addInputNode(referance to Node2)
>
> Operation by networkMain object(for above network)
> // Check if new data exists
> If Node1.newData()
> Node1.resetDataFlag() (Is set when new data written)
> ModuleA.process()
> ModuleB.process()
> ModuleC.process()
> (Must be done after ModuleB has finished)
I'm not sure what object is reading data from the Device in your example above.
Perhaps ModuleA? If I am understanding the above correctly, then we stillrun
into the problem of having dependant processing nodes which might take too long
before we got back to the next read() on the Device. Meaning that ModuleC
could not be called until ModuleB was done, and ModuleB could not be called
until ModuleA was done, and so forth. Once Node1.newData senses waiting data
from the Device (ModuleA?), then it will start processing the node tree and,
when finished with the last Module, finally get back to reading from the
Device.
Or do you see the Device being in its own separate thread, and feeding data
into the node network in some other way? Since you mention that each Node has
it's own data stream, then I am thinking that you are envisioning the Device
thread and the node-complex thread connected by a buffered stream?
Dave.
This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:43 BST