GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Nov 23, 2014 9:57 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: GTK - Getting high performance on algorithm execution.
PostPosted: Fri Sep 28, 2012 11:50 pm 
Offline

Joined: Fri Sep 28, 2012 11:37 pm
Posts: 3
Hello,

I am a newbie with GTK and I have a question in regard of the execution time.

I am making a program that has an algorithm with a very high execution time (many hours), and I am making the gui with gtk and C. My question is if the best performance is achieved using the function gtk_idle_add? Or maybe I can run my algorithm an call some function that check if some event has happened?

BTW, the algorithm is dynamic programming and I am programming in ubuntu linux with GTK+ 3 .

Hope I was clear with my question.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: GTK - Getting high performance on algorithm execution.
PostPosted: Sat Sep 29, 2012 12:45 am 
Offline
GTK+ Guru

Joined: Fri Mar 25, 2011 5:16 pm
Posts: 177
Location: USA
gtk_idle_add has been deprecated since version 2.4. There's g_idle_add () and g_idle_add_full () from GLib.
http://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-idle-add

To execute a function when a condition on a channel is satisfied there are the GLib functions:
g_io_create_watch()
g_io_add_watch ()
g_io_add_watch_full ()

http://developer.gnome.org/glib/2.32/glib-IO-Channels.html#g-io-create-watch


Top
 Profile  
 
 Post subject: Re: GTK - Getting high performance on algorithm execution.
PostPosted: Mon Oct 01, 2012 4:07 pm 
Offline

Joined: Fri Sep 28, 2012 11:37 pm
Posts: 3
Thanks for your anwer zerohour.

I am trying to understand how to use it. If you know a place where I can find some example I would really appreciate it.

Thanks.


Top
 Profile  
 
 Post subject: Re: GTK - Getting high performance on algorithm execution.
PostPosted: Mon Oct 01, 2012 8:22 pm 
Offline

Joined: Fri Sep 28, 2012 11:37 pm
Posts: 3
Here I found a good example:

http://developer.gnome.org/gdk/stable/g ... -idle-full


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group