Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99356 > unrolled thread

Futex hang when running event loop on a separated thread

Started byMarc Aymerich <glicerinu@gmail.com>
First post2015-11-24 16:29 +0100
Last post2015-11-24 16:29 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Futex hang when running event loop on a separated thread Marc Aymerich <glicerinu@gmail.com> - 2015-11-24 16:29 +0100

#99356 — Futex hang when running event loop on a separated thread

FromMarc Aymerich <glicerinu@gmail.com>
Date2015-11-24 16:29 +0100
SubjectFutex hang when running event loop on a separated thread
Message-ID<mailman.6.1448379007.20593.python-list@python.org>
Hi,

I have to run the asyncio.loop on a separated thread because the main
thread is running FUSE. Apparently fuse needs to run on the main
thread because it uses signal():

....
File "/usr/local/lib/python3.4/dist-packages/fuse.py", line 390, in __init__
    old_handler = signal(SIGINT, SIG_DFL)
ValueError: signal only works in main thread


Anyway, when I exit the program it appears that i run into a deadlock
with the eventloop thread, strace is stuck with:

....
futex(0x7f7ba0000c10, FUTEX_WAIT_PRIVATE, 0, NULL


I've tried to stop the event loop from the main thread but the
situation is exactly the same :(

loop_container = {}
handler = threading.Thread(target=run_loop, args=(loop_container,))
try:
   handler.start()
   FUSE(fs)
finally:
    loop_container['loop'].stop()
    # handler.join()

Any idea on how I can shutdown the hole thing? I have to manually kill
the program each time :(

-- 
Marc

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web