On Wednesday 29 November 2006 05:44, Wookey wrote:
> On 2006-11-28 10:56 +0800, eq wrote:
> > Hi:
> > Why not gc implement as a task .Now every time such as write ,gc
> > works,is it make write speed slow down?
>
> It has to happen sometime. It doesn't take any less time just because
> you did it in a thread. This way it is nice and predicatable and yaffs
> remains simple and single-threaded which is good on simpler systems
> and avoids a whole class of bugs.
>
> There may be circumstances where a separate thread would make sense.
> Does you situation really need threaded GC?
Since yaffs does "gross locking", threading issues are not that complicated.
Thus far, yaffs only does gc in the thread of a modifying operation (any that
writes to nand including write, open, close, unlink...).
This does mean that after you've deleted a whole lot of files there is a lot
of garbage to collect which can slow down the first few nodifying operations
after a file deleting exercise.
A gc thread would be relatively easy to add and would mean that some of this
gc could happen in the background (eg. while the user it thinking and not
doing file system operations).
-- CHarles