Git Product home page Git Product logo

Comments (6)

Slids avatar Slids commented on May 4, 2024 1

Thats what I mean.

from lisp-koans.

Slids avatar Slids commented on May 4, 2024

Nope, purely illustrative.

from lisp-koans.

phoe avatar phoe commented on May 4, 2024

I've posted sionescu/bordeaux-threads#70 - let's see how it goes.

from lisp-koans.

Slids avatar Slids commented on May 4, 2024

Just to not the code alluded to is:

(defun signal-semaphore (semaphore)
(bordeaux-threads:signal-semaphore
(semaphore-semaphore semaphore))
(incf (semaphore-count semaphore)))

(defun wait-on-semaphore (semaphore)
(bordeaux-threads:wait-on-semaphore
(semaphore-semaphore semaphore))
(decf (semaphore-count semaphore)))

(defun semaphore-name (semaphore)
(semaphore-name (semaphore-semaphore semaphore)))

;; Incrementing a bordeaux-threads semaphore is an atomic operation
;; but our increment is not.
(defvar g-semaphore (make-our-semaphore :name "g" :count 0))

(defun semaphore-increments-g ()
(signal-semaphore g-semaphore))

(define-test test-increment-semaphore
(assert-equal ___ (semaphore-count g-semaphore))
(bordeaux-threads:join-thread (bordeaux-threads:make-thread 'semaphore-increments-g :name "S incrementor 1"))
(bordeaux-threads:join-thread (bordeaux-threads:make-thread 'semaphore-increments-g :name "S incrementor 2"))
(bordeaux-threads:join-thread (bordeaux-threads:make-thread 'semaphore-increments-g :name "S incrementor 3"))
(assert-equal ___ (semaphore-count g-semaphore)))

It's probably useful to find a semaphore count for purely testing the semaphore code,
but not for anyone else, so no great reason to export such a function.
It also bugs me I see no testing for threads in CCL

from lisp-koans.

phoe avatar phoe commented on May 4, 2024

It also bugs me I see no testing for threads in CCL

What do you mean, testing? You mean no tests for threads in CCL the implementation? I cannot see them in https://github.com/Clozure/ccl-tests/ either.

from lisp-koans.

phoe avatar phoe commented on May 4, 2024

Clozure/ccl-tests#6

from lisp-koans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.