473,660 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading, real or simulated?

Sam
I'm using Python 2.3.5 with pygtk 2.4.1, and I'm using the second threading
approach from pygtk's FAQ 20.6 - invoking "gtk.gdk.thread s_init()", and
wrapping all gtk/gdk function calls with
gtk.threads_ent er()/gtk.threads_lea ve()

I start a thread, via thread.Threadin g.start(). The thread then calls a
particularly time consuming C function, from an extension module. I find
that when the thread is running the C code, the GUI hangs even though I'm
not inside the threads_enter/threads_leave territory.

It looks like thread.Threadin g() only simulates threading, by having the
python interpreter multiplex between running threads. Is real threading
possible, so that I do something time-consuming in the thread, without
hanging the GUI?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQBDMet3x9p 3GYHlUOIRAgSDAJ 9E4zB95NqllaX/yqkBjIuvqngyBAC dFGUR
aD7zKkA9Sb3aTHj NMJZgQZA=
=CcvF
-----END PGP SIGNATURE-----

Sep 21 '05 #1
0 1189

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
6725
by: Anthony_Barker | last post by:
I have been reading a book about the evolution of the Basic programming language. The author states that Basic - particularly Microsoft's version is full of compromises which crept in along the language's 30+ year evolution. What to you think python largest compromises are? The three that come to my mind are significant whitespace, dynamic typing, and that it is interpreted - not compiled. These three put python under fire and cause...
0
3495
by: David | last post by:
I've written a small windows service, and I'm having a problem that I'm spending a lot more time on than I'd like. If anyone has experienced this problem and has any hints or solutions; they would be appreciated. Simply leaving the threadMain() method if something unexpected occurs during thread execution leaves the thread in a ThreadState.Running state. This (apparently??) causes the Thread.Join() in service.OnStop() to hang...
3
2928
by: Jochus | last post by:
Hi! I'm study Industrial Enginering Informatics (second year) and we have to write a a program that writes out HTML timetables of classes (school classes, I mean ...). First we have to read in the information: * how many teachers are there? * what subjects do teachers give? * what are the specific classrooms ?
13
1805
by: John | last post by:
I've got some reasonably complex business logic in my C# code, in a class called by a ASP.NET page. This takes around 3-4 seconds to execute. It's not dependent on SQL calls or anything like that. I know of the problems with the worker process doing two things at once from the main thread pool (The old "Sit in a tight loop for 20 seconds and watch all your webapps die!" issue). So I've worked around the issue by spawning the business...
1
1140
by: Dara Durum | last post by:
Hi ! I don't understand something. Under Python the threads are simulated by Python Interpreter as when prev. setted pieces (interval) of the interpreted tokens are executed, it is change to another "virtual" thread ? Or it was really create real threads, and they are figth for the priority, and for the execution time ?
9
1852
by: cgwalters | last post by:
Hi, I've recently been working on an application which does quite a bit of searching through large data structures and string matching, and I was thinking that it would help to put some of this CPU-intensive work in another thread, but of course this won't work because of Python's GIL. There's a lot of past discussion on this, and I want to bring it up again because with the work on Python 3000, I think it is worth trying
14
1753
by: dE|_ | last post by:
For months I have been happily using a downloaded JS file and inline script to embed and control the parameters of SWF files which I use as mp3 players with actionscript. The last so.addParam controls the simple function auto-play; OFF but since recent real player installations this has been taking over starting them all off and even offering downloads. This may be annoying for some writers but it is critical for the site I use this...
14
3437
by: Akihiro KAYAMA | last post by:
Hi all. I found cooperative multi-threading(only one thread runs at once, explicit thread switching) is useful for writing some simulators. With it, I'm able to be free from annoying mutual exclusion, and make results deterministic. For this purpose, and inspired by Ruby(1.9) fiber, I wrote my own version of fiber in Python.
126
6682
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard: http://www.cse.wustl.edu/~schmidt/ACE.html the same way that the STL (and subsequently BOOST) have been subsumed? Since it already runs on zillions of platforms, they have obviously worked most of the kinks out of the generalized threading and processes idea (along with many...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.