[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

.dat files



In our projects we have noticed that there is a locking problem when
accessing .dat files. It seems the problems is only in threaded
applications on Windows system, and we suspect Windows (at least
NT) implementations of JVM cannot lock files in read-only mode.
It means when two concurrent threads are using our parser one is throwing
an exception that the lexer.dat is not available. This problem does not
occur on *nix systems at all.  It is a "bug" or "feature" of either
Windows or given JDK implementation. ANyway, we have solved that problem
by including the code of Lexer and Parser constructors inside a
synchronized block, which is sunchronized on some static object. 

Hope it might help others  ;o)
best regards
Mariusz