Commits

Anonymous committed a7d02c9

preparatory work for sub-event concurrency

Comments (0)

Files changed (2)

pkg/gaudi/kernel/datastore/datastore.go

 
 type datastore struct {
 	store kernel.DataStore //map[string]interface{}
+	//store map[string]chan interface{}
 }
 
 func (self *datastore) Put(key string, value interface{}) {
+	// _, ok := self.store[key]
+	// if !ok {
+	//  	self.store[key] = make(chan interface{}, 1)
+	// }
+	
+	// self.store[key] <- value
 	self.store[key] = value
 }
 
 func (self *datastore) Get(key string) interface{} {
 	value, ok := self.store[key]
+	// if !ok {
+	//  	self.store[key] = make(chan interface{}, 1)
+	// }
 	if ok {
+		//v := <-value
+		//self.store[key] <- v
 		return value
 	}
 	return nil
 
 func (self *datastore) Has(key string) bool {
 	_, ok := self.store[key]
-	if !ok {
-		delete(self.store, key)
-	}
+	// if !ok {
+	// 	delete(self.store, key)
+	// }
 	return ok
 }
 
 	n := self.CompName()
 	if _, ok := store[n]; !ok {
 		dstore := make(kernel.DataStore)
+		//dstore := make(map[string]chan interface{})
 		store[n] = dstore
 	}
 
 	dstore := store[n].(kernel.DataStore)
+	//dstore := store[n].(map[string]chan interface{})
 	if dstore != nil {
 		return &datastore{dstore}
 	}

pkg/gaudi/tests/joboptions/fast-jobo.py

 app.props.EvtMax = 10
 app.props.OutputLevel = 1
+#app.props.NbrProcs = 0
 #app.props.NbrProcs = 1
 
-nworkers = 1
+#nworkers = 0
+#nworkers = 1
 nworkers = 50
 
 app.svcs += Svc(