X Tutup
The Wayback Machine - https://web.archive.org/web/20230217044227/https://github.com/python/cpython/issues/36387
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

Tkinter lock conflicts extension widgets #36387

Closed
jyrkialakuijala mannequin opened this issue Apr 5, 2002 · 8 comments
Closed

Tkinter lock conflicts extension widgets #36387

jyrkialakuijala mannequin opened this issue Apr 5, 2002 · 8 comments
Labels
expert-tkinter pending The issue will be closed if no feedback is provided type-feature A feature request or enhancement

Comments

@jyrkialakuijala
Copy link
Mannequin

jyrkialakuijala mannequin commented Apr 5, 2002

BPO 539907
Nosy @loewis, @devdanzin, @asvetlov

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2002-04-05.18:13:48.000>
labels = ['type-feature', 'expert-tkinter']
title = 'Tkinter lock conflicts extension widgets'
updated_at = <Date 2014-02-03.19:13:24.517>
user = 'https://bugs.python.org/jyrkialakuijala'

bugs.python.org fields:

activity = <Date 2014-02-03.19:13:24.517>
actor = 'BreamoreBoy'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tkinter']
creation = <Date 2002-04-05.18:13:48.000>
creator = 'jyrkialakuijala'
dependencies = []
files = []
hgrepos = []
issue_num = 539907
keywords = []
message_count = 7.0
messages = ['61084', '61085', '81812', '81814', '81815', '114179', '114182']
nosy_count = 5.0
nosy_names = ['loewis', 'jyrkialakuijala', 'ajaksu2', 'gpolo', 'asvetlov']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue539907'
versions = ['Python 3.3']

@jyrkialakuijala
Copy link
Mannequin Author

jyrkialakuijala mannequin commented Apr 5, 2002

I need to access the thread lock in the _tkinter.c.

I have the following callgraph:

  1. Python code
  2. Tcl/Tk event loop (tkinter mainloop->)
  3. Mouse callback to my own Tk extension widget
  4. A lot of C++ stuff, which is also called directly
    from python
  5. Python
  6. Calling tk (which crashes due to the tk lock)

It is be possible to avoid this by creating a
tcl event with a python callback instead of calling
c++ from the tk extension widget. However, in a
painting program this is not ok for performance.
The real time capabilities of Python are pretty
bad and mouse movement becomes stopped for a few
milliseconds every now and then, leaving significant
discontinuities in the mouse tracking.

I have been able to have excellent behavior by
exposing the thread lock of _tkinter.c and release
the tk-lock when the call from the widget enters
the C++ side and lock it again when the C++ side
returns.

However, this is not possible with the standard
_tkinter.c, because the lock is a static member.
There are two possible solutions that would fix
my problems:

  1. real-time python mode, that allows for turning
    off GC and all other possible delays in the
    interpreter. Then I could use the python for
    managing tk events without mouse jumps.

  2. exposing the thread lock with a simple api that
    allows the use of LEAVE_TCL and ENTER_TCL outside
    _tkinter.

The 2) is simpler. It consists of removing a keyword
"static" in _tkinter.c, while real-time python
is probably a 3.0 thing? Thus I would vote for a
fix in _tkinter.c for allowing me not to compile
my own python.

@jyrkialakuijala jyrkialakuijala mannequin added expert-tkinter type-feature A feature request or enhancement labels Apr 5, 2002
@loewis
Copy link
Mannequin

loewis mannequin commented Jun 9, 2002

Logged In: YES
user_id=21627

Just removing the static on the lock is not sufficient, if
_tkinter.so is a shared library. Instead, providing a
CObject in _tkinter would help.

Would you like to produce a patch for that?

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 12, 2009

No reply from OP, will close unless someone argues against it.

@gpolo
Copy link
Mannequin

gpolo mannequin commented Feb 12, 2009

Why close ? It is still a valid feature request (with no patch yet).

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 12, 2009

Leaving open, then :)

Thanks!

@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Aug 17, 2010

@guilherme I'm guessing that you're still interested in this, yes?

@gpolo
Copy link
Mannequin

gpolo mannequin commented Aug 17, 2010

@guilherme I'm guessing that you're still interested in this, yes?

I don't see the point in closing an issue simple because no one
responded. I think the question to be asked is more towards "is it
solved?" than "are you interested on it?". If the issue is invalid
considering all the changes that happened since the initial message
then I'm in favor in closing it.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
@kumaraditya303
Copy link
Contributor

No comments in last 10+ years and it seems abandoned. I'll close this if no one objects.

@kumaraditya303 kumaraditya303 added the pending The issue will be closed if no feedback is provided label Sep 22, 2022
@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-tkinter pending The issue will be closed if no feedback is provided type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant
X Tutup