Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eager-future2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vladimir Sedach
eager-future2
Commits
0558f0da
Commit
0558f0da
authored
14 years ago
by
Vladimir Sedach
Browse files
Options
Downloads
Patches
Plain Diff
Updated documentation.
parent
2f7849ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README
+5
-1
5 additions, 1 deletion
README
library.lisp
+2
-3
2 additions, 3 deletions
library.lisp
scheduler.lisp
+4
-0
4 additions, 0 deletions
scheduler.lisp
with
11 additions
and
4 deletions
README
+
5
−
1
View file @
0558f0da
...
@@ -85,7 +85,7 @@ function force (future &rest values) => nil
...
@@ -85,7 +85,7 @@ function force (future &rest values) => nil
macro pexec (&body body) => future
macro pexec (&body body) => future
A s
horthand for (pcall (lambda () ...))
.
S
horthand for (pcall (lambda () ...))
macro plet ((&rest bindings) &body body)
macro plet ((&rest bindings) &body body)
...
@@ -126,3 +126,7 @@ function select-timeout (timeout &rest futures) => future or nil
...
@@ -126,3 +126,7 @@ function select-timeout (timeout &rest futures) => future or nil
macro pfuncall (function &rest args) => result
macro pfuncall (function &rest args) => result
Evaluates args in parallel before funcalling the given function on them.
Evaluates args in parallel before funcalling the given function on them.
function touch (x) => value
If x is a future, yields its value, otherwise returns x.
This diff is collapsed.
Click to expand it.
library.lisp
+
2
−
3
View file @
0558f0da
(
in-package
#:eager-future2
)
(
in-package
#:eager-future2
)
(
defmacro
pexec
(
&body
body
)
(
defmacro
pexec
(
&body
body
)
"
A s
horthand for (pcall (lambda () ...))
.
"
"
S
horthand for (pcall (lambda () ...))"
`
(
pcall
(
lambda
()
,@
body
)))
`
(
pcall
(
lambda
()
,@
body
)))
(
defmacro
plet
((
&rest
bindings
)
&body
body
)
(
defmacro
plet
((
&rest
bindings
)
&body
body
)
...
@@ -78,8 +78,7 @@ elapsed, or the first yieldable future otherwise."
...
@@ -78,8 +78,7 @@ elapsed, or the first yieldable future otherwise."
(
funcall
,
function
,@
syms
))))
(
funcall
,
function
,@
syms
))))
(
defun
touch
(
x
)
(
defun
touch
(
x
)
"If x is a future, yields its value, otherwise returns x.
"If x is a future, yields its value, otherwise returns x."
Borrowed from MultiLisp."
(
if
(
typep
x
'future
)
(
if
(
typep
x
'future
)
(
yield
x
)
(
yield
x
)
x
))
x
))
This diff is collapsed.
Click to expand it.
scheduler.lisp
+
4
−
0
View file @
0558f0da
...
@@ -29,10 +29,14 @@
...
@@ -29,10 +29,14 @@
(
with-recursive-lock-held
(
*thread-counter-lock*
)
(
incf
*total-threads*
)))
(
with-recursive-lock-held
(
*thread-counter-lock*
)
(
incf
*total-threads*
)))
(
defun
thread-pool-size
()
(
defun
thread-pool-size
()
"Returns the current number of threads in the thread pool. This
number determines the maximum amount of speculative futures that can
be computed at the same time."
(
with-recursive-lock-held
(
*thread-counter-lock*
)
(
with-recursive-lock-held
(
*thread-counter-lock*
)
*total-threads*
))
*total-threads*
))
(
defun
advise-thread-pool-size
(
new-size
)
(
defun
advise-thread-pool-size
(
new-size
)
"Attempts to set the amount of threads in the thread pool to given value."
(
with-recursive-lock-held
(
*thread-counter-lock*
)
(
with-recursive-lock-held
(
*thread-counter-lock*
)
(
if
(
<
*total-threads*
new-size
)
(
if
(
<
*total-threads*
new-size
)
(
loop
repeat
(
-
new-size
*total-threads*
)
do
(
make-pool-thread
))
(
loop
repeat
(
-
new-size
*total-threads*
)
do
(
make-pool-thread
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment