Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 2004 14:07:28 -0400 (EDT)
From:      Robert Watson <rwatson@FreeBSD.rg>
To:        Waldemar Kornewald <Waldemar.Kornewald@web.de>
Cc:        FreeBSD-net <freebsd-net@freebsd.org>
Subject:   Re: locking
Message-ID:  <Pine.NEB.3.96L.1040924140514.82478J-100000@fledge.watson.org>
In-Reply-To: <4152A3E9.8080700@web.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, 23 Sep 2004, Waldemar Kornewald wrote:

> we at the Haiku networking team are considering a port of your 5.3
> netstack because it is thread-safe and making the old one (4.x, I think)
> thread-safe is probably a much bigger task. 
> 
> Now, I saw that the routing code seems to use macros for the locking
> code. Do you use macros everywhere? 
> 
> We would prefer having native threads and locks. Haiku only has
> semaphores, not mutexes, is that a problem? 
> 
> Could you think of some other difficulties we could run into when
> porting it? 

There are some sections of the network stack, such as the KAME IPSEC
implementation, parts of IPv6, and some device drivers, which are not yet
completely MPSAFE.  This may or may not be an issue depending on what
your requirements are.  If you have any bug fixes or improvements, we
would love to hear about them -- right now our locking is fairly
coarse-grained but we'll be looking at contention issues over the next few
months to see how best to refine our locking strategy.

Regarding synchronization -- semaphores can be used to implement mutual
exclusion, and so you could simply implement the locking macros in terms
of semaphores rather than mutexes.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Principal Research Scientist, McAfee Research



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040924140514.82478J-100000>