update cmsapi example to multi thread