Megatest

Check-in [825534b56a]
Login
Overview
Comment:Added beginnings of a common context var for passing area specific values to calls
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.62
Files: files | file ages | folders
SHA1: 825534b56ac6f492e06fa95554691423f502fd3f
User & Date: mrwellan on 2016-11-07 13:32:04
Other Links: branch diff | manifest | tags
Context
2016-11-10
15:13
Added example of nanomsg parallizaation check-in: f1f44b078f user: mrwellan tags: v1.62
2016-11-07
13:32
Added beginnings of a common context var for passing area specific values to calls check-in: 825534b56a user: mrwellan tags: v1.62
2016-11-04
11:14
Bumped version check-in: 482fb399b7 user: matt tags: v1.62, v1.6208
Changes

Modified common.scm from [3661dd25c9] to [41eb86f112].

41
42
43
44
45
46
47


48
49
50

51



52









53
54
55
56
57
58
59
60
      (debug:print-error 0 *default-log-port* "bad value for setenv, key=" key ", value=" val)))

(define home (getenv "HOME"))
(define user (getenv "USER"))

;; GLOBAL GLETCHES



;; Common data structure for 
(defstruct cxt
  (taskdb #f))





(define *contexts* (make-hash-table)) ;; toppath => cxt










(define *db-keys* #f)

(define *configinfo*   #f)   ;; raw results from setup, includes toppath and table from megatest.config
(define *runconfigdat* #f)   ;; run configs data
(define *configdat*    #f)   ;; megatest.config data
(define *configstatus* #f)   ;; status of data; 'fulldata : all processing done, #f : no data yet, 'partialdata : partial read done
(define *toppath*      #f)







>
>


|
>

>
>
>
|
>
>
>
>
>
>
>
>
>
|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
      (debug:print-error 0 *default-log-port* "bad value for setenv, key=" key ", value=" val)))

(define home (getenv "HOME"))
(define user (getenv "USER"))

;; GLOBAL GLETCHES

(define *contexts* (make-hash-table))

;; Common data structure for 
(defstruct cxt
  (taskdb #f)
  (cmutex (make-mutex)))

;; safe method for accessing a context given a toppath
;;
(define (common:with-cxt toppath proc)
  (mutex-lock! *context-mutex*)
  (let ((cxt (hash-table-ref/default *contexts* toppath #f)))
    (if (not cxt)
        (set! cxt (let ((x (make-cxt)))(hash-table-set! *contexts* toppath x) x)))
    (let ((cxt-mutex (cxt-mutex cxt)))
      (mutex-unlock! *context-mutex*)
      (mutex-lock! cxt-mutex)
      (let ((res (proc cxt)))
        (mutex-unlock! cxt-mutex)
        res))))
        
(define *db-keys* #f)

(define *configinfo*   #f)   ;; raw results from setup, includes toppath and table from megatest.config
(define *runconfigdat* #f)   ;; run configs data
(define *configdat*    #f)   ;; megatest.config data
(define *configstatus* #f)   ;; status of data; 'fulldata : all processing done, #f : no data yet, 'partialdata : partial read done
(define *toppath*      #f)