Re: signal_timeout vs loops (changing label text continuously)



On Tue, 2006-27-06 at 11:50 -0500, Bob Caryl wrote:
> The docs page for Glib::Thread is 
> http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1Thread.html
> 
> Basically, to use a "thread" you first write a function to do the work 
> you wish to have done outside the GUI thread.  Then you create the 
> thread using
> 
> Glib::Thread *my_thread = 
> Glib::Thread::create(sigc::mem_fun(*this,&YourClass::your_thread_function),false);  
> 
> 
> Then, your function will be executed by that thread and the thread will 
> exit when your function returns. 
> 
> In my example the function that is passed to Glib::Thread::create is a 
> member of a class, but you do not have to do that if you do not want to; 
> you can use sigc::ptr_fun() instead:
> 
> Glib::Thread *my_thread = 
> Glib::Thread::create(sigc::ptr_fun(&your_thread_function),false);
> 
> Hope this helps,

Bob, that helps me implement a thread, which is great, but I also want
to understand what threads are and how they work. How do they relate to
forks and so on. Is there a book or something I can read to understand
this further.

Thanks,
-Gezim




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