Re: GIOSchedulerJobs vs the main loop



On Thu, 2008-01-24 at 21:51 -0500, Matthias Clasen wrote:
> While porting the trashapplet to gio, I noticed that GIOScheduler runs
> the job function as an atomic unit. While that may be ok when threads
> are available and it runs in its own thread, copying an entire
> directory tree (as an example) in an idle function can possibly block
> the mainloop for undue amounts of time.
> 
> Here is a simple patch that allows a GIOSchedulerJobFunc to do its job
> in chunks, by returning a boolean. The scheduler will keep the idle
> alive until the job is done and the function returns FALSE. Job
> functions can maintain state between the invocations by storing it in
> user_data. In the threaded case, the job function gets simply called
> in a loop until it is done.
> 
> Does this look ok to commit ?

I recently added another use of g_io_scheduler_push_job () to gfile.c
which needs conversion too. Otherwise it seems good to me.
Nautilus would need some changes after this i think...



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