|
Meta tags:
description=At the interactive prompt, EventHook ran Tcl events with Tcl_DoOneEvent(TCL_DONT_WAIT) and slept for 20 ms when there was nothing to do, so an idle interactive session with Tk loaded woke up about 100 times per second.
On Unix with threaded Tcl, it now waits with Tcl_DoOneEvent(0), as mainloop() does. This is safe because stdin is watched by a Tcl file handler, so input still wakes it up. Whether Tcl is threaded is known from tcl_lock, which is freed as soon as a threaded interpreter is created, so no other changes are needed and the fix can be backported. Polling is kept on Windows, where stdin is not a Tcl event source, and for non-threaded Tcl.
Measured with an interactive Python driven through a pseudo-terminal under Xvfb, with Tk 8.6: idle wakeups dropped from about 98 to 0 per second; after() callbacks, input, Ctrl-C and exceptions in callbacks behave as before, with and without readline.
Thanks to @mdehoon for the analysis in the issue.
🤖 Generated with Claude Code
Issue: gh-140488;
Headings (most frequently used words):
the, navigation, uh, oh, gh, 140488, do, not, poll, in, tkinter, event, loop, at, interactive, prompt, 162557, footer, diff, view, menu, repository, there, are, no, files, selected, for, viewing, filter, by, extension,
Text of the page (most frequently used words):
the (21), file (19), github (16), and (15), this (12), applied (11), for (11), line (9), tcl_lock (9), 140488 (9), all (8), reload (8), you (7), that (7), not (7), 2026 (7), suggestion (7), cannot (7), suggestions (7), while (7), code (7), event (7), show (7), sign (7), changes (6), loading (6), tcl_tstate (6), diff (6), hidden (6), characters (6), unicode (6), can (5), security (5), there (5), prompt (5), result (5), open (5), loop (5), interactive (5), tkinter (5), issue (5), serhiy (5), storchaka (5), commits (5), your (5), please (4), pull (4), comments (4), null (4), number (4), bidirectional (4), learn (4), about (4), view (4), next (4), rst (4), files (4), poll (4), support (4), copilot (4), community (3), navigation (3), request (3), from (3), change (3), add (3), batch (3), commit (3), was (3), error (3), page (3), retry (3), events (3), py_end_allow_threads (3), tcl_dooneevent (3), tstate (3), py_begin_allow_threads (3), else (3), eventhook (3), what (3), review (3), more (3), modules (3), _tkinter (3), misc (3), news (3), library (3), bw4tiq (3), hide (3), whitespace (3), filter (3), nov (3), 162557 (3), merged (3), python (3), account (3), quality (3), another (3), tab (3), window (3), refresh (3), session (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), build (3), contact (2), status (2), privacy (2), terms (2), footer (2), now (2), merge (2), single (2), one (2), viewing (2), toggle (2), expand (2), instead (2), sleep (2), tkinter_busywaitinterval (2), pythread_release_lock (2), tcl_dont_wait (2), pythread_acquire_lock (2), input (2), tcl (2), threaded (2), 3792 (2), original (2), contains (2), text (2), may (2), interpreted (2), compiled (2), differently (2), than (2), appears (2), below (2), editor (2), reveals (2), desktop (2), delete (2), edit (2), additions (2), deletions (2), selected (2), apply (2), split (2), unified (2), failed (2), load (2), jump (2), nbsp (2), extension (2), main (2), into (2), select (2), tree (2), insights (2), projects (2), actions (2), repository (2), cpython (2), signed (2), with (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), business (2), fixes (2), products (2), secret (2), perform, action, time, share, personal, information, manage, cookies, docs, inc, right, check, back, later, queued, multi, pending, reviews, has, been, marked, resolved, outdated, must, existing, order, create, valid, applying, deleted, lines, supported, only, per, subset, closed, invalid, because, were, made, annotations, notes, oops, something, went, wrong, down, returning, without, readline, report, exception, raised, callback, but, keep, pumping, endif, wait, polling, stdin, watched, myfileproc, break, type, file_type_disk, void, process, does, wake, every, few, milliseconds, idle, polls, unix, waits, running, longer, mod, are, conversations, clear, filters, viewed, types, remote, tracking, branch, upstream, 23e529f, d5f8cab, hold, shift, click, range, changed, checks, conversation, busywait, already, clicking, agree, our, occasionally, send, related, emails, statement, service, free, its, maintainers, have, question, project, new, items, requests, issues, message, dismiss, alert, switched, accounts, out, appearance, settings, search, pricing, talks, workshops, partners, company, forum, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, see, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, source, latest, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, tasks, automated, work, hosting, collaboration, platform, menu, skip, content,
|