Esempio n. 1
0
    /**
     *
     * massimot: experimental code
     *
     * This method provides the same interface of the push one but uses the
     * multipush method to provide a batch of items to the consumer thus
     * ensuring better cache locality and lowering the cache trashing.
     *
     * \return TODO
     */
    inline bool mpush(void * const data) {
        if (!data) return false;

        if (mcnt==MULTIPUSH_BUFFER_SIZE)
            return multipush();

        multipush_buf[mcnt++]=data;

        if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush();

        return true;
    }
Esempio n. 2
0
    /**
     *
     * massimot: experimental code
     *
     * This method provides the same interface of the push one but uses the
     * multipush method to provide a batch of items to the consumer thus
     * ensuring better cache locality and lowering the cache trashing.
     *
     * \return TODO
     */
    inline bool mpush(void * const data) {
        assert(data != NULL);

        if (mcnt==MULTIPUSH_BUFFER_SIZE)
            return multipush();

        multipush_buf[mcnt++]=data;

        if (mcnt==MULTIPUSH_BUFFER_SIZE) return multipush();

        return true;
    }
Esempio n. 3
0
 /* REW -- ? */
 inline bool flush() {
     return (mcnt ? multipush(multipush_buf,mcnt) : true);
 }
Esempio n. 4
0
 inline bool flush() {
     return (mcnt ? multipush() : true);
 }