multi thread support
multi thread support r2