numthreads = numbuckets