|
Posted by Jerry Stuckle on 01/23/06 22:47
Iván Sánchez Ortega wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jerry Stuckle wrote:
>
>
>>You can never eliminate all locks. The secret is to minimize the number
>>and length of the locks.
>
>
> That is a concurrent programming technique; I know it as "make the critical
> section as small and fast as possible".
>
> (A critical section is the code that runs with the locks "on", and never
> runs in paralell to another critical section)
>
> Make sure the critical section has a very small complexity (usually O(1) ),
> make sure there are no deadlocks, rely on listeners and events instead of
> active waiting, and you should be fine.
>
No, don't relay on listeners or events, either. Don't wait on anything
you don't absolutely have to. For instance - you may need to wait for
another database operation to finish (i.e. updating two tables).
But never turn control over to someone else (i.e. wait for an event).
What happens if an event gets lost?
> - --
> - ----------------------------------
> Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net
>
> Un ordenador no es un televisor ni un microondas, es una herramienta
> compleja.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
>
> iD8DBQFD1Sxn3jcQ2mg3Pc8RAhJCAJ9cfP5EuPS1wy6rHwOZacuKrYMTlACeNJBK
> zKYT7bqw+irlbJoXWlkaQzs=
> =XAH6
> -----END PGP SIGNATURE-----
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|