[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Thu, 8 Feb 2018 08:25:55 -0500 (EST) |
branch: master
commit 54256392719b291548aa936e9e185797f2523f04
Author: Ludovic Courtès <address@hidden>
Date: Thu Feb 8 14:05:17 2018 +0100
examples: random: Make derivations a bit more random.
* examples/random-jobs.scm (random-derivation): Tweak the computation of
SEED. Actually use the new random state.
---
examples/random-jobs.scm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/examples/random-jobs.scm b/examples/random-jobs.scm
index 9918cd1..9d26892 100644
--- a/examples/random-jobs.scm
+++ b/examples/random-jobs.scm
@@ -33,10 +33,11 @@
(let ((nonce (random 1e6)))
(run-with-store store
(gexp->derivation "random"
- #~(let ((seed (logxor (getpid)
- (car (gettimeofday)))))
- (seed->random-state seed)
- (sleep (pk 'sleeping (random 10)))
+ #~(let* ((seed (logxor #$(cdr (gettimeofday))
+ (car (gettimeofday))
+ (cdr (gettimeofday))))
+ (state (seed->random-state seed)))
+ (sleep (pk 'sleeping (random 10 state)))
#$nonce
(mkdir #$output))))))
- master updated (e656f42 -> 5425639), Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject],
Ludovic Courtès <=
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08
- [no subject], Ludovic Courtès, 2018/02/08