lkml.org 
[lkml]   [1997]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Suggestion for Linux 2.3

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


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.020 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site