Implement rendering thread