Re: Adaptive thread creation by the kernel

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 6 Feb 2000 19:05:30 +0000 (GMT)


> > if (mincore(map, readlength, vec))
> > perror("mincore");
> >
> > the vec[] contains a byte for each page you queried. each byte has value
> > "1" if the page is already in memory, otherwise "0".
>
> You do a syscall every time you're going to read part of a file?
> How do you ensure it's still there by the time you actually read it?

It might not be,

> How do you force the page in when it's not in memory -- spawn
> another thread?

Bingo. Thats how the hacked thttpd uses mincore - a way to ask the kernel if
it should go making threads for this request

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/