message during thread execution and javascript