mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] non-recursive mutexes


From: Markus:
Subject: Re: [MIT-Scheme-devel] non-recursive mutexes
Date: Wed, 10 Jun 2015 10:18:00 +0800



  Original Message  
From: Markus:
Sent: Wednesday, June 10, 2015 10:17
To: Arthur A. Gleckler; Taylor R Campbell
Cc: address@hidden
Subject: Re: [MIT-Scheme-devel] non-recursive mutexes



Regards,
Markus‎
From: Arthur A. Gleckler
Sent: Tuesday, June 9, 2015 13:05
To: Taylor R Campbell
Cc: address@hidden
Subject: Re: [MIT-Scheme-devel] non-recursive mutexes

On Monday, June 8, 2015, Taylor R Campbell <address@hidden> wrote:
 
   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.

Only if your logging routines need to get at the rest of the web
server data structures.  If your logging routines are self-contained,
the lock ordering issue is trivial and needn't even be mentioned --
you could factor logging out into another library, like C stdio.

Still, when logging is used in the web server, the lock needs to reside somewhere.  It shouldn't have to be passed around separately from the web server, so I just incorporated it into the web server.
 
(C stdio streams have locks too -- but you don't usually notice, even
if you call printf while you hold some pthread_mutex, because you
~never have to write code that runs with the stdio stream locked.)

Interesting.

I'm not sure what interactions might happen at the Scheme level, though.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]