|
From: | Markus: |
Subject: | Re: [MIT-Scheme-devel] non-recursive mutexes |
Date: | Wed, 10 Jun 2015 10:16:11 +0800 |
Regards, Markus
On Monday, June 8, 2015, Taylor R Campbell <address@hidden> wrote:
It sounds like you would be better served by having two locks: the web The log file is specific to the particular web server instance, so the lock that controls the log file belongs in the web server data structure. Having two locks opens the possibility of ordering problems. Having just one eliminates that issue. I'll look over my code again, but all the cases where I am using recursive Initially, I changed me code that way, but the result was repetitive and ugly. I revived my own recursive `with-thread-mutex-locked' in a new procedure called `with-thread-mutex-locked-recursive'. That way, it's at least marked. I'm prepared to believe that the tradeoff works as you suggest in more complex cases, but in such simple ones as this, it appears to work the other way. The few cases actually requiring nontrivial recursion tend to have Yes, but I would certainly label these cases "trivial recursion."
|
[Prev in Thread] | Current Thread | [Next in Thread] |