Re: Some questions about concurrency (mostly)

2020-11-12 Thread Fredrik Appelberg
Thanks everyone, this thread has been enlightening :) I understand dynamic-wind better now, but for my purposes a handle-exceptions macro is probably sufficient. Cheers, -- Fredrik

Re: Some questions about concurrency (mostly)

2020-11-08 Thread Jörg F. Wittenberger
Am Sun, 8 Nov 2020 02:17:58 + schrieb Chris Vine : > I wonder therefore why you think that this renders the proposed > with-lock function inappropriate, if that is what you were implying? > Perhaps you weren't and were making some other point. Macros for > handling resources such as mutex

Re: Some questions about concurrency (mostly)

2020-11-07 Thread Chris Vine
On Sat, 7 Nov 2020 20:02:12 -0500 John Cowan wrote: > On Sat, Nov 7, 2020 at 5:51 PM Chris Vine wrote: > >On Fri, 6 Nov 2020 17:20:04 +0100 > >"Jörg F. Wittenberger" wrote: > > > This approach is bound to fail badly. > > > > > > It works just as long as there are a) no exceptions raised in

Re: Some questions about concurrency (mostly)

2020-11-07 Thread John Cowan
On Sat, Nov 7, 2020 at 5:51 PM Chris Vine wrote: > For my elucidation, why? The indentation of the code isn't ideal but > the whole purpose of dynamic-wind is to handle code leaving the thunk in > case of exception, application of a continuation object or regular > return. > You're right

Re: Some questions about concurrency (mostly)

2020-11-07 Thread Chris Vine
On Fri, 6 Nov 2020 17:20:04 +0100 "Jörg F. Wittenberger" wrote: > Am Thu, 05 Nov 2020 23:22:09 +0100 > schrieb Fredrik Appelberg : > > > 3. I'm new to dynamic-wind. If I wanted to create a general form for > >executing a thunk protected by a mutex, would this be a good idea? > > > >

Re: Some questions about concurrency (mostly)

2020-11-06 Thread Jörg F. Wittenberger
Am Fri, 06 Nov 2020 17:48:26 +0100 schrieb felix.winkelm...@bevuta.com: > > I'm not doing any call/cc or non-local exit shenanigans, but the > > code uses srfi-18 threads and does I/O over TCP. As I understand > > it, srfi-18 is implemented using continuations. Will that cause > > problems with

Re: Some questions about concurrency (mostly)

2020-11-06 Thread felix . winkelmann
> I'm not doing any call/cc or non-local exit shenanigans, but the code > uses srfi-18 threads and does I/O over TCP. As I understand it, srfi-18 > is implemented using continuations. Will that cause problems with my > with-lock function? I'm thinking that a thread that has aquired the lock > in

Re: Some questions about concurrency (mostly)

2020-11-06 Thread Jörg F. Wittenberger
Am Thu, 05 Nov 2020 23:22:09 +0100 schrieb Fredrik Appelberg : > 3. I'm new to dynamic-wind. If I wanted to create a general form for >executing a thunk protected by a mutex, would this be a good idea? > > (define (with-lock mutex thunk) >(dynamic-wind >(lambda ()

Re: Some questions about concurrency (mostly)

2020-11-06 Thread Fredrik Appelberg
felix.winkelm...@bevuta.com writes: Hi, and thanks for the reply :) >> 1. Are there any problems with creating a condition (as in exception, >>not srfi-18 condition variable) in one thread and raising it in one >>or more other threads? > > No problem here, I'd say, data can be freely

Re: Some questions about concurrency (mostly)

2020-11-06 Thread felix . winkelmann
> 1. Are there any problems with creating a condition (as in exception, >not srfi-18 condition variable) in one thread and raising it in one >or more other threads? No problem here, I'd say, data can be freely exchanged between threads, since they share a global address space. A condition

Some questions about concurrency (mostly)

2020-11-05 Thread Fredrik Appelberg
Hi all, I learned Scheme back in my university days, but that was mostly computer sciency, SICP stuff. Now I'm trying to get actual, practical work done, and have to read up on threads, I/O and all that jazz. So I have some newbie questions: 1. Are there any problems with creating a condition