• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
          • Vl-lint
          • Vl-server
            • Vls-scannedalist-p
            • Vls-loadedalist-p
            • Vls-commands
            • Vls-data-p
            • Vl-server-opts-p
            • Vl-descriptionlist-summaries
            • Vls-transdb
            • Vl-describe
            • Ts-queue
              • Ts-queue-len
              • Ts-enqueue
              • Ts-dequeue
            • Vls-get-plainsrc
            • Vl-description->warnings
            • Vls-showloc
            • File-layout
            • Vls-remove-from-scannedalist
            • Vls-describe
            • Vl-server-top
            • Vls-port-table
            • Vl-find-description-insensitive
            • Vls-get-warnings
            • Vls-get-summary
            • Vls-get-origsrc
            • Vl-ppc-description
            • Vls-get-parents
            • Vls-get-children
            • Vls-data-origname-reportcard
            • Vls-data-from-zip
            • Start
            • Vls-make-scannedalist
            • Vls-get-summaries
            • Vls-get-unloaded-json
            • Vls-get-desctypes
            • Vls-scannedalist-to-json
            • Vls-loadedalist-to-json
            • Vl-description-summary
            • *vl-server-help*
            • Vl-descalist->descriptions/types
            • Stop
          • Vl-gather
          • Vl-zip
          • Vl-main
          • Split-plusargs
          • Vl-shell
          • Vl-json
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-server

Ts-queue

Primitive thread-safe, shared queue.

Note that when using this queue, there is no way for the producer to signal that he is done. A consequence is that this queue structure should only be used when consumers are continually looping and waiting for work to be added to the queue.

This is appropriate, for instance, for the client handler threads that always wait on the incoming connections queue for a new client to connect, and for the loader thread that is always and forever waiting to be told to load new models.

Subtopics

Ts-queue-len
(ts-queue-len queue) returns the current length of the data list for queue. It can be used at any time by any thread and never blocks.
Ts-enqueue
(ts-enqueue obj queue) safely adds obj to queue, signals the queue's semaphore to allow the object to be consumed by some consumer, and finally returns obj.
Ts-dequeue
(ts-dequeue queue) safely removes and returns the oldest object from a queue. If no objects are available, it blocks until an object is added.