Skip to content

Instantly share code, notes, and snippets.

@shomah4a
Created December 20, 2011 14:58
Show Gist options
  • Save shomah4a/1501845 to your computer and use it in GitHub Desktop.
Save shomah4a/1501845 to your computer and use it in GitHub Desktop.
thread + print
#-*- coding:utf-8 -*-
import time
from pypy.module.thread import ll_thread
def add(x, y):
return x + y
def test():
while 1:
print 10
def main(argv):
print add(1, 2)
print add(1.0, 2.0)
print add(1.0, 1)
ll_thread.start_new_thread(test, ())
time.sleep(10)
return 0
def target(x, y):
return main, None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment