Updating code for tickless mode, added code for the light thread.