in reply to Replacing closures (to work around threads crash)
Is there an alternative way to replace closures with something else?
The trouble with your question, beyond that like others, I cannot reproduce your problem, is that your example code doesn't show why you are trying to use closures. That is to say, devoid of the original context, your example code doesn't make any sense (to me). It makes it very hard to recommend an alternative, when it's not clear for what purpose you are trying to use them in the first place.
In your example, you are closing over a local, unshared array. That means each thread will get it's own copy of that array. However, it's not clear to me what purpose that array will serve?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Replacing closures (to work around threads crash)
by eyepopslikeamosquito (Archbishop) on Nov 22, 2004 at 08:27 UTC | |
by BrowserUk (Patriarch) on Nov 22, 2004 at 09:39 UTC | |
by castaway (Parson) on Nov 22, 2004 at 08:40 UTC | |
by eyepopslikeamosquito (Archbishop) on Nov 22, 2004 at 08:53 UTC |