Re: Suggestion for Linux 2.3

Jared Mauch (jared@wolverine.hq.cic.net)
Tue, 7 Jan 1997 09:22:35 -0500 (EST)


There's a decent article on Threads in the Feb `97 Linux Journal
which showed up yesterday..

You might want to get that, I think they have their articles
and code segments online at http://www.ssc.com/

- Jared

Ingo Molnar graced my mailbox with this long sought knowledge:
>
> On Tue, 7 Jan 1997, William Burrow wrote:
>
> > In different note, someone pointed out to me that in some cases an
> > application is required to know when a disk write occurs. Would it be
> > possible to have some mechanism in the buffer/cache system to send a
> > signal to an app when buffers have bee flushed that requested this signal?
>
> you can do this with threads, in user-space, using LinuxThreads:
>
> ------------------------------------------------------>
> pthread_cond_init(cond1);
> pthread_create(newthread,do_controlled_async_writeout);
>
> <do stuff>
>
> pthread_cond_wait(cond1);
>
> ...
>
> do_controlled_async_writeout()
> {
> do_a_blocking_write();
> pthread_cond_signal(cond1);
> pthread_exit(this);
> }
> <------------------------------------------------------
>
> or whatever synronization method you want, this conditional variable is
> just one example.
>
> this solution is fast, cheap and robust.
>
> -- mingo
>