"i" is needed only if we have threads
Cast to const