locking
Robert Watson
rwatson at FreeBSD.rg
Fri Sep 24 11:08:15 PDT 2004
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 at fledge.watson.org Principal Research Scientist, McAfee Research
More information about the freebsd-net
mailing list