Megatest

Check-in [18868f44fd]
Login
Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64-synclaunch-threaded-q
Files: files | file ages | folders
SHA1: 18868f44fd07e5c73329377c60e946c8c4c4efb5
User & Date: bb on 2018-02-12 01:18:12
Other Links: branch diff | manifest | tags
Context
2018-02-12
15:58
added threaded queue example check-in: b7bca59fa9 user: bjbarcla tags: v1.65
01:18
wip Leaf check-in: 18868f44fd user: bb tags: v1.64-synclaunch-threaded-q
2018-02-09
00:24
wip check-in: 607db6ebc5 user: bb tags: v1.64-synclaunch-threaded-q
Changes

Modified example/q/threaded-queue.scm from [0280ba0d98] to [cba8217f2c].

255
256
257
258
259
260
261





262
263
264
265
266
267
268
269
  

       
(define (tjq:new #!key (qname (gensym)) (sync-job-cap 100))
  (let* ((job-hash (make-hash-table))
         (obj-mbox (make-mailbox)))
    (letrec





        ((dispatch-thread (tjq:dispatcher-thread qname job-hash sync-job-cap obj))
         (obj
          (lambda (op . args)
            (cond
             ((eq? op 'event-loop)
              (print "got event-loop")
              (thread-join! dispatch-thread)
              (print "after thread-join dispatch-thread")







>
>
>
>
>
|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
  

       
(define (tjq:new #!key (qname (gensym)) (sync-job-cap 100))
  (let* ((job-hash (make-hash-table))
         (obj-mbox (make-mailbox)))
    (letrec
        ((dispatch-thread
          (tjq:dispatcher-thread
           job-thread-timeout-seconds: 0.01
           timeout-seconds: 0.01

           qname job-hash sync-job-cap obj))
         (obj
          (lambda (op . args)
            (cond
             ((eq? op 'event-loop)
              (print "got event-loop")
              (thread-join! dispatch-thread)
              (print "after thread-join dispatch-thread")
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
             (iota 6))
    ;;(thread-sleep! 10)
    (q 'drain)
    ;;(q 'event-loop)
    ))

(define (test-submit-bunch2)
  (let* ((q (tjq:new qname: 'test-q sync-job-cap: 42)))
    (for-each (lambda (x)
                ;;(let* ((cmd (conc "echo did job "x)))
                (let* ((cmd "/bin/true"))
                  ;;(print "submit it--"x)
                  (q 'submit cmdline: cmd))
               )
             (iota 600))
    ;;(thread-sleep! 10)
    (q 'drain)
    ;;(q 'event-loop)
    ))

;(test-tjq-simple)
;;(test-submit)
;;(test-drain-simple)
(print "top")
(test-submit-bunch2)







|






|










329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
             (iota 6))
    ;;(thread-sleep! 10)
    (q 'drain)
    ;;(q 'event-loop)
    ))

(define (test-submit-bunch2)
  (let* ((q (tjq:new qname: 'test-q sync-job-cap: 20 )))
    (for-each (lambda (x)
                ;;(let* ((cmd (conc "echo did job "x)))
                (let* ((cmd "/bin/true"))
                  ;;(print "submit it--"x)
                  (q 'submit cmdline: cmd))
               )
             (iota 6000))
    ;;(thread-sleep! 10)
    (q 'drain)
    ;;(q 'event-loop)
    ))

;(test-tjq-simple)
;;(test-submit)
;;(test-drain-simple)
(print "top")
(test-submit-bunch2)