Jason King wrote:
> I'm writing a small door server, which passes some structured data back and 
> forth between the client and the door server.   Unless I'm mistaken (very 
> possible), you can either pass fds between the client & server, or a chunk of 
> memory.  It seems like using a packed nvlist would (at initial glance at 
> least) be a very good fit (and simpler) for passing the data back and forth 
> instead of trying to manually pack the data myself or try to send the data 
> over an fd.
>
> Since I've not messed with door servers (or nvlists, though they look very 
> handy) before, I was wondering if there are any downsides I should be aware 
> of?
>   

Nvlists are great for data that may change, or for cases when you need
to handle arbitrarily structured data.  Property lists are a good example.

I've used them in an application like this (passed by ioctl to/from the
kernel) for nvlists, to pass cryptographic data, because I didn't
necessarily know in advance what kinds of data would be needed.  (E.g.
DH requires different kinds of parameters than RSA, which is different
than DES, which is different than RC4, etc. etc.)

However, nvlists are not free, and there is a cost associated with
packing and unpacking them.  If your data is highly structured, or
extremely simple, and not likely to need the flexibility that nvlists
provide, then passing as a fixed (or maybe even versioned) structure is
likely to be much faster in a performance sensitive application.

    -- Garrett
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>   


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to