예제 #1
0
    void add_items(void)
    {
        for (long i = 0; i != node_count; ++i)
        {
            long id = generate_id<long>();

            bool inserted = data.insert(id);
            assert(inserted);

            while(stk.push(id) == false)
                thread::yield();
            ++push_count;
        }
    }
예제 #2
0
void add_items(void)
{
    unsigned long count = 1000000;

    for (long i = 0; i != count; ++i)
    {
        thread::yield();
        long id = generate_id<long>();

        bool inserted = data.insert(id);

        assert(inserted);

        stk.push(id);
    }
}