Some question about thread pools



Hi all, 

I want to use thread pools for my app. Now I'm curious whether I did
understand the principle of a thread pool right, or not. 

So, I will just line out this in two sentences or so, and *please*
correct me if I should be wrong ... :-)



Well, I have some pice of data arriving occasionally over the net. The
processing of this data takes a quite long time, and so I wanted to give
this data over to a thread pool to deal with this.

I would init the pool with
        tp = g_thread_pool_new(func, NULL???, num, TRUE, NULL);

(This seems strange to me - I don't have any user data yet when
initializing the thread pool ... or did I get something wrong here?)

Assuming the init went correct I would push the arriving packets
(the pointers to them ;-) with 
        g_thread_pool_push(tp, my_pointer, NULL);
to give them some meat.


Please comment and / or correct :-)


Greetings and thanks, 

                Axel.



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