Fix check against threshold in shmalloc.
Add reduction example