Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Is curses module thread-safe? Date: Mon, 18 Nov 2013 16:38:06 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 19 Message-ID: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1384792686 21027 64.122.56.22 (18 Nov 2013 16:38:06 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 18 Nov 2013 16:38:06 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:59884 I'm working on a program that uses the curses module, and I'd like to use multiple threads (using the threading module). Is the curses module in the standard library usable from multile threads? I found a discussion from about 15 years ago that indicated it wasn't at that time. The example being discussed was that when one thread calls a blocking getch(), the GIL isn't released and wall threads stop. The suggesting work-around was to wrap the call to getch() with a select() on sys.stdin. Is that still an issue? If two threads call addstr() "simultaneously" is it handled properly? Or do all curses calls need to be made by a single thread? -- Grant Edwards grant.b.edwards Yow! It don't mean a at THING if you ain't got gmail.com that SWING!!