gnustep-dev
[Top][All Lists]
Advanced

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

Re: Possible code simplification and optimisation


From: Manuel Guesdon
Subject: Re: Possible code simplification and optimisation
Date: Wed, 22 Oct 2003 16:24:44 +0200 (CEST)

On Wed, 22 Oct 2003 12:53:59 +0100 Richard Frith-Macdonald <address@hidden> 
wrote:
[...]
 >| So, a GSLazyLock keeps track of its own state in a BOOL, and 
 >| metamorphoses into an NSLock when the program becomes multithreaded,
 >| while a GSRecursiveLock keeps track of the number of times it has been 
 >| locked in a counter.
 >| Classes using these locks can therefore be coded with no need to be 
 >| aware of whether the program is running in single or multi-threaded 
 >| mode.
 >| 
 >| Now -
 >| I could add these as private classes and use them internally in the 
 >| base library
 >| or I could add them as public classes in the Additions part of the base 
 >| library
 >| or I could change the existing NSLock/NSRecursiveLock classes so that 
 >| they do the same sort of thing.

The 3rd solution seems great.
The only problem I can imagine is using NSxxLock in a non multithreaded 
environnement but really want to lock the mutex but I can't imagine a reason 
now.
Idon't know enough DO so I can't say if this new feature may hurt something (is 
it 
possible to use NSxxLock between applicationswich communicate by DO ?).


Manuel






reply via email to

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