DragonFly kernel List (threaded) for 2008-05
DragonFly BSD
DragonFly kernel List (threaded) for 2008-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: kthread_create and rel_mplock


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sun, 18 May 2008 21:26:28 +0200

Michael Neumann wrote:
If I understand the kthread_create correctly, it will always acquire the
mplock (something like a global lock). That means, if I create two
threads, they will automatically be serialized (i.e. run sequentially),
unless I release the lock within a thread manually. Is that correct?

kthread_* is old stuff and should be avoided. If possible, use lwkt_*. These threads then run without process context and without the mplock.


Is mtx_lock(&Giant) equivalent to the mplock on DragonFly?

Yes, I think so.


My understanding is that it is equivalent, and that I don't need any
further critical sections.

You do, to prevent from interrupts happening on the same CPU. Other BSDs use(d) spl* for this purpose, we have crit_*.


cheers
  simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \




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