On Thu, 5 Oct 2006, Erblichs wrote:

Casper Dik,

        After my posting, I assumed that a code question should be
        directed to the ZFS code alias, so I apologize to the people
        show don't read code. However, since the discussion is here,
        I will post a code proof here. Just use "time program" to get
        a generic time frame. It is under 0.1 secs for 500k loops
        (each loop does removes a obj and puts it back).

        It is just to be used as a proof of concept that a simple
        pre-alloc'ed set of objects can be accessed so much faster
        than allocating and assigning them.

Ok, could you please explain how is this piece (and all else, for that matter):

/*
 * Get a node structure from the freelist
 */
struct node *
node_getnode()
{
        struct node *node;

        if ((node = nodefree) == NULL)  /* "shouldn't happen" */
                printf("out of nodes");

        nodefree = node->node_next;
        node->node_next = NULL;

        return (node);
}

is multithread-safe ?

Best wishes,
FrankH.



_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to