Giter VIP home page Giter VIP logo

ufo-thread-pool's Introduction

# Overview

This package is a dependable thread pool package for chez scheme. I hacked chez-a-sync(https://github.com/ChrisVine/chez-a-sync) and simplified it. And my purpose is making this library easily imported into other code.

This package is published with Akku(https://akkuscm.org/), which is a language package manager for Scheme. 

This package has been tested with Chez Scheme versions 9.4 and 9.5.


# Requirement 

This package uses chez scheme's FFI to call up the pipe() and poll() system calls.  It therefore requires a UNIX-like operating system to function correctly.  It has been tested with linux and should work on the BSDs and on Mac OS X. If using OS X, the glibtool package will be required.

This package also requires chez scheme to have been compiled with the --threads option.

# API
Usage please refer to tests/test-ufo-thread-pool.sps.

1. (init-thread-pool [size] [blocked]) =>thread-pool
>NOTE: (init-tread-pool) with auto-confiured pool size is only available to Linux.
2. (thread-pool? value)=>#t/#f
3. (thread-pool-blocked?-ref pool)=>#t/#f
4. (thread-pool-blocked?-change pool #f/#t)=>#t/#f
5. (thread-pool-thread-number-ref pool)=>thread-number
6. (thread-pool-job-number-ref pool)=>job-number
7. (thread-pool-size-ref pool)=>size
8. (thread-pool-size-add pool value)=>size
9. (thread-pool-add-job pool job [fail-handler])=>result 
10. (thread-pool-stop! pool)
11. (with-thread-pool-increment pool body0 body1 ...)

# Test
> bash test.sh

ufo-thread-pool's People

Contributors

ufo5260987423 avatar

Watchers

 avatar  avatar  avatar

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.