Re: multithread



On Wednesday 16 November 2005 11:21, yeajchao wrote:
Hello everybody
   my program involved in multithread
   but I have no any idea about it
   in my program,there  need two threads,and each
thread has a timer
     when the timer is timeout ,it will awake the
corresponding thread,
       and after the thread finished its work,it will
sleep again ,wait for its timer

   can anybody will be so kind as to give me some
advise ?
    an example may even better

For the timer, you may be able to use g_timeout_add_full(), depending on what 
timeout accuracy you want.

For doing the work, you could consider using a thread pool, so you do not have 
to create a new thread with each timeout.  See 
http://developer.gnome.org/doc/API/2.0/glib/glib-Thread-Pools.html

Chris




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