Re: Threads and main-loops



John K Luebs wrote:
On Thu, Sep 02, 2004 at 06:08:50PM +1000, Russell Shaw wrote:

John K Luebs wrote:

On Thu, Sep 02, 2004 at 04:56:26PM +1000, Russell Shaw wrote:
Hi,

If i make multiple loops with:

GMainLoop *loop1=g_main_loop_new(context1,TRUE);
GMainLoop *loop2=g_main_loop_new(context2,TRUE);
GMainLoop *loop3=g_main_loop_new(context3,TRUE);
g_main_loop_run(loop1);
g_main_loop_run(loop2);
g_main_loop_run(loop3);

...

Now if you were just illustrating, and actually planning on nesting the
g_main_loop_runs, then that might be a viable design. I was just curious
why you needed "mutiple mainloops."
My gut tells me that there are limited cases where you would want more
than one context per thread.

Have Fun,
 -jkl

Hi,
Thanks, is clearer now. I needed to have a mental model (i think visual)
of threading and loop contexts to design the overall architecture of my app.



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