[Click] C++ vs the kernel

Adam M click at irotas.net
Tue Jul 24 16:48:15 EDT 2007


On Tue, 24 Jul 2007 16:40:04 -0400, "Roman Chertov"
<rchertov at purdue.edu> said:
> I think most elements implement a configure function.  This is where you 
> can fail the creation of your element and then things will exit 
> gracefully.  If you really want to use some intermediate classes that 
> are non-"elements", then you can always create a class factory which 
> will return NULL pointers if the creation fails.

Yeah, I assumed that would have to be the convention. Thanks for the
clarification.


> The issue with memory allocation in Linux is very problematic during 
> interrupts if you are holding locks.  This especially applies to 
> spin_locks. (I found that out the hard way).  However, if you are 
> operating in kernel memory only and use the proper locking primitives 
> then it is my understanding that kalloc should work without issues.  Or 
> you can always allocate while you are not in a critical section.

For now I think I'll pursue trying to figure out how to use
KernelTap/Tun to avoid these sticky little issues like this. :)


Thanks again,
Adam


More information about the click mailing list