[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Futures: Avoid creating the worker pool more than once
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Futures: Avoid creating the worker pool more than once |
Date: |
Sat, 17 Nov 2012 00:15:07 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Hi Mark,
Mark H Weaver <address@hidden> skribis:
> From b0d936a348b916e73e9071abeb7baae3d7c126d3 Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <address@hidden>
> Date: Wed, 7 Nov 2012 08:39:42 -0500
> Subject: [PATCH] Futures: Avoid creating the worker pool more than once.
>
> * module/ice-9/futures.scm (%create-workers!): Use 'with-mutex' in case
> an exception is thrown. Within the critical section, check to make
> sure the worker pool hasn't already been created by another thread.
> ---
> module/ice-9/futures.scm | 24 +++++++++++++++---------
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
>
> diff --git a/module/ice-9/futures.scm b/module/ice-9/futures.scm
> index 0f64b5c..7fbccf6 100644
> --- a/module/ice-9/futures.scm
> +++ b/module/ice-9/futures.scm
> @@ -19,6 +19,7 @@
> (define-module (ice-9 futures)
> #:use-module (srfi srfi-1)
> #:use-module (srfi srfi-9)
> + #:use-module (ice-9 threads)
> #:use-module (ice-9 q)
> #:export (future make-future future? touch))
I just realized that this patch introduces a circular dependency between
the two modules.
Can you think of a way to avoid it?
Thanks,
Ludo’.