Java: thread-safe RandomAccessFile

Posted by Folkert van Heusden on Stack Overflow See other posts from Stack Overflow or by Folkert van Heusden
Published on 2010-05-21T12:52:55Z Indexed on 2010/05/21 14:10 UTC
Read the original article Hit count: 250

Filed under:
|
|
|

Hi,

After some serious googleing I found out that the RandomAccessFile-class is not thread-safe. Now I could use one semaphore to lock all reads and writes but I don't think that performs very well. In theory it should be possible to do multiple reads and one write at a time. How can I do this in Java? Is it possible at all?

Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about thread