[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: threading
- From: Bryan Wilkinson <nardo pobox com>
- To: GTK <gtk-app-devel-list redhat com>
- Subject: Re: threading
- Date: Fri, 18 Jun 1999 02:43:09 -0400 (EDT)
> > while(1)
> > {
> > pthread_mutex_lock(draw_mutex);
> > while(gtk_events_pending())
> > {
> > gtk_main_iteration();
> > }
> > pthread_mutex_unlock(draw_mutex);
> > sleep(0);
> > }
[snip]
> when I trying the following code in gtk:
>
> while(1)
> while(gtk_events_pending()) {
> gtk_main_iteration();
> }
>
> I noticed that this little gtk application eat up all my cpu's spare
> time!
the sleep(0) in my code prevents it from using all spare cycles.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]