if ( Graph()->IsDataStreamNode() ) {
StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
}
+ Graph()->InLineServices() ;
+
if ( !Graph()->ValidLoops() ) {
cdebug_out << "This DataFlow have not valid Loops." << endl ;
return false ;
}
+ if ( !Graph()->ValidSwitchs() ) {
+ cdebug_out << "This DataFlow have not valid Switchs." << endl ;
+ return false ;
+ }
// CreateService() ;
- Graph()->InLineServices() ;
-
Graph()->ComputingNodes() ;
_Valid = true ;
- cdebug_out << "GraphExecutor::OutNode::Valid" << endl;
+ cdebug_out << "GraphExecutor::OutNode::Valid " << _Valid << endl;
return _Valid ;
}
// GraphExecutor::DataReadyState ) ;
// We say that we have to create a thread for that HeadNode 'anInNode'
anInNode->CreateNewThread( true ) ;
+ IncrCreatedThreads() ;
anInNode->DataFromNode( Graph()->Name() ) ;
// AndSuspend == true <==> Start()
if ( AndSuspend ) {
<< EventQSize() << endl ;
cdebug << "================================================================================" << endl ;
+//JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
+ if ( pthread_mutex_lock( &_MutexWait ) ) {
+ perror("EventLoop pthread_mutex_lock ") ;
+ exit( 0 ) ;
+ }
// asv : fix for 6798 and other bugs: "sift" the event queue after execution
siftEvents();
+ if ( pthread_mutex_unlock( &_MutexWait ) ) {
+ perror("PushEvent pthread_mutex_unlock ") ;
+ exit( 0 ) ;
+ }
// asv : 25.10.04 : calling Editing() to indicate stop of execution
Graph()->GraphEditor()->Editing();
}
// cdebug_out << "PushEvent Threads " << Threads() << " SuspendedThreads "
// << SuspendedThreads() << endl ;
-#if 0
- if ( _EventNodes.size() > 101 ) {
- while ( _EventNodes.size() > 31 ) {
- _EventNodes.pop_front() ;
- _Events.pop_front() ;
- _States.pop_front() ;
- }
+
+//JR 21.02.2005 Debug : old events should be removed at creation time for python-clients
+ int EventNodesSize = _EventNodes.size() ;
+ if ( _EventNodes.size() > (unsigned int)Graph()->GraphNodesSize()*70 ) {
+ siftEvents();
+ cdebug << "OutNode::PushEvent " << _EventNodes.size() << " in queue instead of "
+ << EventNodesSize << endl ;
}
-#endif
+
if ( pthread_mutex_unlock( &_MutexWait ) ) {
perror("PushEvent pthread_mutex_unlock ") ;
exit( 0 ) ;
SUPERV::GraphEvent & anEvent ,
SUPERV::GraphState & aState ,
bool WithWait ) {
+//JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
+ if ( pthread_mutex_lock( &_MutexWait ) ) {
+ perror("EventLoop pthread_mutex_lock ") ;
+ exit( 0 ) ;
+ }
// asv : fixing problem of loops with large number of iterations (>5000)
// experimentally was found that number of non-handled by GUI events = (number_of_nodes x 7)
// or 7 events for each node - so what we want to do here is remove "old" events for nodes
// "on the fly". Once again it is done in Stop(), Kill(), Done() functions.
+ int EventNodessize = _EventNodes.size() ;
if ( _EventNodes.size() > (unsigned int)Graph()->GraphNodesSize()*7 )
siftEvents();
int SuspendedThreadsNumber ;
bool cdebuginout = false ;
if ( _EventNodes.size() > 0 ) {
-// cdebug_in << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue" << endl ;
+ cdebug_in << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue instead of "
+ << EventNodessize << endl ;
cdebuginout = true ;
}
- if ( pthread_mutex_lock( &_MutexWait ) ) {
- perror("EventLoop pthread_mutex_lock ") ;
- exit( 0 ) ;
- }
_JustStarted = false ;
ThreadsNumber = Threads() ;
SuspendedThreadsNumber = SuspendedThreads() ;
return aret ;
}
-bool GraphExecutor::OutNode::IsDone( const char * NodeName ,
- const char * ServiceParameterName ) {
+bool GraphExecutor::OutNode::PortDone( const char * NodeName ,
+ const char * ServiceParameterName ) {
// cdebug_in << "GraphExecutor::OutNode::IsDone " << NodeName << " "
// << ServiceParameterName<< endl;
bool aret = Graph()->PortDone( NodeName , ServiceParameterName ) ;
<< " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads
<< " EventQSize " << EventQSize() << endl ;
+ if ( pthread_mutex_lock( &_MutexWait ) ) {
+ perror("EventLoop pthread_mutex_lock ") ;
+ exit( 0 ) ;
+ }
+//JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
// remove "extra" events from the event queue
siftEvents();
+ if ( pthread_mutex_unlock( &_MutexWait ) ) {
+ perror("PushEvent pthread_mutex_unlock ") ;
+ exit( 0 ) ;
+ }
// asv : 25.10.04 : calling Editing() to indicate stop of execution
Graph()->GraphEditor()->Editing();