Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tornado.ioloop.IOLoop.instance() should be threadsafe #497

Merged
merged 1 commit into from
May 7, 2012
Merged

tornado.ioloop.IOLoop.instance() should be threadsafe #497

merged 1 commit into from
May 7, 2012

Conversation

polymorphm
Copy link
Contributor

tornado.ioloop.IOLoop.instance() should be threadsafe (for example -- using pattern "double-checked locking")

if tornado.ioloop.IOLoop.instance() will NOT be threadsafe, then next function will be NOT threadsafe too:

def my_other_thread_function_a():
    tornado.ioloop.IOLoop.instance().add_callback(my_function_b)

so, despite the fact that add_callback() is threadsafe -- there is no simple way to use add_callback() from other thread

pattern "double-checked locking" -- will not reduce speed of access to instance

bdarnell added a commit that referenced this pull request May 7, 2012
tornado.ioloop.IOLoop.instance() should be threadsafe
@bdarnell bdarnell merged commit 8f44acd into tornadoweb:master May 7, 2012
Rudd-O pushed a commit to Rudd-O/tornado that referenced this pull request Jun 27, 2013
tornado.ioloop.IOLoop.instance() should be threadsafe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants