Do native stuff in a thread