Re: SUMMARY: Kernel Threads Usable By Mortals

Matthias Urlichs (smurf@smurf.noris.de)
Tue, 30 Apr 1996 13:26:38 +0100


In linux.dev.kernel, article <199604290239.WAA23830@huahaga.rutgers.edu=
>,
"David S. Miller" <davem@caip.rutgers.edu> writes:
>=20
> void acquire_lock(lock)
> {
> repeat:
> while(mutex_held(lock))
> yield();
> if(!mutex_try(lock))
> goto repeat;
> }
>=20
That while loop is still a busy wait. The fact that you explicitly give
other processes a chance to proceed doesn't change that.

Besides, if more than one process competes for the lock you can still h=
ave
a starvation problem.

--=20
Umbilical Cord: Part of a parachute.
-- Dictionary of Obscure Medical Terms
--=20
Matthias Urlichs \ Noris Network GmbH i.Gr/ Xlink-POP N=FCrnberg=
=20
Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@nor=
is.de
90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc'i=
ng
PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE=20
Click <A HREF=3D"http://info.noris.de/~smurf/finger">here</A>. =
42