lkml.org 
[lkml]   [1999]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: mmap() and threads BUG
Date
> It seems that if you use mmap(),memcpy(),munmap() to read/write to a
> portion of a file, you can get corrupt data. There appears to be no
> thread-safe alternative besides this method to do offset-thread-safe
> reads and writes on Linux.

Interesting. That looks like some kind of mapping race in 2.0 yes. I'll
have a look for that before doing a final 2.0.37.

> Does this program work on the "2.2" kernels?
> This program makes it appear that mmap() is really broken in 2.0.36.

2.2 reports

Initializing File
Starting Threads
Thread a starting Write/Read Loop.
Thread b starting Write/Read Loop.
Thread c starting Write/Read Loop.
Thread d starting Write/Read Loop.
Thread e starting Write/Read Loop.
Thread f starting Write/Read Loop.
Thread g starting Write/Read Loop.
Thread h starting Write/Read Loop.
Thread i starting Write/Read Loop.
Waiting for Threads
Thread j starting Write/Read Loop.
Test Exiting

(16Mb 486DX33, Symbios FC920 FC disk)

So it seems to work. It also has pread/pwrite.

Alan


-
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:51    [W:0.030 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site