Re: [Vala] ThreadPool



 
    > On Sunday, 14 April 2019, 14:44:46 BST, Wolfgang Mauer <wolfgang mauer kabelmail de> wrote: > is it 
possible to remove all "unprocessed" Threads in a ThreadPool?
Practically I would like to remove all "pending/unprocessed" thread in 
the pool before I add a new one.

You could use the ThreadPool's move_to_front () to prioritise the new task.I understand ThreadPool to be a 
parallelised version of foreach. A functionis passed in when the ThreadPool is created and data is then fed 
in with push ().

If the processing is complete and you want to remove the remaining data to starta new run then use free () 
and create a new ThreadPool. That's the only way Ican think of.
Some references if it 
helps:http://changelog.ca/log/2012/10/09/vala_glib_thread_poolhttps://stackoverflow.com/questions/29883007/gthreadpool-is-not-creating-more-than-n-threadshttps://developer.gnome.org/glib/stable/glib-Thread-Pools.html
Al
  


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