tech-net archive

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

Re: re(4) mpsafe



Hi Jared

On 17/04/2017 00:45, Jared McNeill wrote:
In a (failed) attempt to get more performance out of re(4) on
NetBSD/arm, I've made some changes to re(4) to support NET_MPSAFE. I'm
not too familiar with code in this area, so I thought I'd post it for
feedback:

  http://www.invisible.ca/tmp/re-mpsafe.patch


+#define	RE_LOCK(_sc)		mutex_enter(&(_sc)->sc_lock)
+#define	RE_UNLOCK(_sc)		mutex_exit(&(_sc)->sc_lock)

+	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NET);
+

My only comment would be one of consistency. You hide the locking mechanism in macros, but not the init/destruction part.

Roy


Home | Main Index | Thread Index | Old Index