java.nio.FileLock

The end of java.nio.FileLock specification tells us

see:

http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/FileLock.html

Some network filesystems permit file locking to be used with memory-mapped files only when the locked regions are page-aligned and a whole multiple of the underlying hardware's page size. Some network filesystems do not implement file locks on regions that extend past a certain position, often 230 or 231. In general, great care should be taken when locking files that reside on network filesystems.

What do the mean under "page-aligned" and

"xtend past a certain position, often 230 or 231"?

[667 byte] By [dbes@isd.dp.uaa] at [2007-11-26 16:27:52]
# 1

Memory on computers is usually split into pages. These are normally powers of two in sizse (e.g. 1024, 2048 or 4096). The region you are locking, when using memory mapped files, sometimes must be a multiple of whichever page size is use by the OS that is hosting the network drive.

Some network filesystems will not lock a region whose upper location is more then then 1Gig or 2Gig into the file being mapped.

matfud

matfuda at 2007-7-8 22:52:08 > top of Java-index,Java Essentials,Java Programming...