Skip to content

Concurrent versions of map/filter/foreach using bordeaux-threads

Notifications You must be signed in to change notification settings

garlic0x1/fusillade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fusillade

Introduction

Concurrent alternatives to make map/filter/foreach using bordeaux-threads.

The functions spawn workers that consume items from a list or queue as soon as they are ready for one.

git clone https://github.com/garlic0x1/fusillade.git ~/quicklisp/local-projects/fusillade

Usage

The usage is what you expect, but with an extra first argument to specify the number of threads to use.

(ql:quickload :fusillade)
(use-package :fusillade)

(wmap 4 #'sleep '(1 2 2 2))     ; takes 2 seconds
(wforeach 2 #'sleep '(1 2 2 2)) ; takes 4 seconds
(wfilter 2 #'evenp '(1 2 2 2))  ; instant (no sleep)

Limitations

Since this uses native threads, it is not ideal for heavy IO applications. Perhaps I will add async functions in the future.

Tests are incomplete.

About

Concurrent versions of map/filter/foreach using bordeaux-threads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published