Multi-threaded gtk app very very slow



I have a multi-threaded application that I developed using gtk 2.4.1 (I know it's old - the SA hasn't had 
time to get to it yet - so I'll be moving to latest and greatest soon).
   
  Anyway, this application has multiple "views" - in that you can open different *.glade files (xml) and they 
open up in "viewing window" portion of the screen.  This application acts as a monitor program (like the 
control room in a reactor - numbers go up and down, indicators flex, and levels rise). If I only look at one 
"view", everything is fine.
   
  But if I switch to a different view (to see different numbers, indicators, and levels), things get a little 
strange.  At first glance, everything seems fine.  But if I leave the application up overnight, then the 
application is taking up most 95+% of the cpu, and it runs very very slow. The second I break the app, then 
everything returns to normal.
   
  I ran the debugger and came up with this (for the primary gtk thread - all other threads aren't blocking).
  ??
  _XRead() from libX11.so.6
  _XReply() from libX11.so.6
  _XIDHandler() from libX11.so.6
  XCreatePixmap() from libX11.so.6
  gdk_pixmap_new from gdkpixmap-x11.c
  gdk_window_begin_paint_region from gdkwindow.c
  gtk_main_do_event from gtkmain.c
   
  Is there any particular reason that gdk_pixmap_new should even be running? Any hints about which direction 
I should poke around (besides upgrading gtk - I'm getting to that!)
   
  I've created a few custom widgets for this monitor application, but they are "passive" widgets (no user 
input/effect) - but they are speedy and can do some interesting things.  I'm wondering if I induced this 
"very very slow" response with my widgets? They are based on the standard widgets, but I'm still getting the 
nack of programming widgets.  I'd share them if anyone was interested - might even help debug and fix my 
current problem!
   
  I've been up and down the multi-threaded gtk problems, using gtk_enter(), and gtk_leave() - and using a 
debugger to make sure I have no multi-threaded issues (stepped on myself a number of times I tell ya!). So 
I'm pretty sure I don't have a thread problem (no more X11 asynch problems).
   
  Thanks in advance for any help,
  Mark
  PS - if you ever want to combine CORBA and gtk, use multi-threads rather than the mico dispatcher (it works 
for very very simple things, but cumbersome to setup, event loops get pissy with each-other, and making sure 
you catch all events in a high event quantity system will make you cry)

                
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs.Try it free. 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]