Run code concurrently using the threading module