lkml.org 
[lkml]   [1998]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdevice: /dev/repeat
Jason Burrell wrote:
>
>
> There are problems in multi-process setups. Say I have one process
> which wants to have /dev/repeat return 01010101. I have another
> process which wants 00000000, and another which wants 11111111. The
> first process writes 01010101 to /dev/repeat. The second writes
> 00000000. Then the first finally gets around to reading
> /dev/repeat. Then the third process writes 11111111, and the second
> process reads. Oops. :)

Unlike the blabering in the rest of this thread, this is actually a real
problem.

I guess the same this exists with serial ports, an that is 'solved' (somewhat)
with lock files. /dev/repeat0-9 could also be available to help this.
Any better ideas?

> I could be wrong, but it seems that one of the primary uses of
> /dev/zero are to mmap it and get copy-on-write pages. Adding different
> device objects for different bit patterns doesn't seem too useful to
> me.

Well sure. Example: In the 'wipe' thread it was brought up that random and
urandom are too slow.

dd if=/dev/random of=/dev/repeat bs=512 count=1.
cat /dev/repeat
Very fast, and refilled several times over the operation, random enough.

> If you want a particular repeated pattern, use a function like
> memfill() from Lars Wirzenius's 'publib' library.

IMO you should be able to accomplish this without resorting to C.

--
http://www.linkscape.net/ Linkscape Internet Services 732-541-4214
http://www.linuxrouter.org/ Linux Router Project

At 19981216.11:59 Zulu, Mach 1 was broken with a 1.0080162GHz Dual CPU machine.
I'm the Degenerate Overclocker that did it. http://www.psychosis.com/doa/

-
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/

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