Re: list.h , list_head and C++

From: J.A. MagallÃn
Date: Tue Feb 27 2007 - 11:25:33 EST


On Tue, 27 Feb 2007 08:34:13 -0600, Robert Hancock <hancockr@xxxxxxx> wrote:

> remi.chateauneu@xxxxxxxxx wrote:
> > On Feb 26, 2:26 pm, Robert Hancock <hanco...@xxxxxxx> wrote:
> >> remi.chateau...@xxxxxxxxx wrote:
> >>> My C++ program needs an intrusive list, possibly with RCU
> >>> capabilities.The data structurelist_head, defined in /usr/include/
> >>> linux/list.h , fits perfectly these needs.

In userspace you're better thinking of a STL list protected by some
POSIX threads primitives. Depending on what you really want to do
with the list, for example a shared work queue, you
could look into condition variables or rwlocks.
Use the standard STL list. You will save a lot of work. And they are not
so bad in performance.

--
J.A. Magallon <jamagallon()ono!com> \ Software is like sex:
\ It's better when it's free
Mandriva Linux release 2007.1 (Cooker) for i586
Linux 2.6.19-jam07 (gcc 4.1.2 20070115 (prerelease) (4.1.2-0.20070115.1mdv2007.1)) #2 SMP PREEMPT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/