On 07 Nov 2011, at 09:21, michael.vancann...@wisa.be wrote:
I have been looking at the JVM backend, and noticed that file I/O is not working. I'm asking what is needed to get write(ln) or read(ln) working.
One thing I forgot to mention: threadvars. They are already supported and work (should work) at the same as on other platforms, but it is not possible to automatically run code whenever a thread is started.
The way this is solved in Java is actually quite good, I think: threadvars are descendants of the java.lang.ThreadLocal class, and whenever you call the get() method of such an instance for the first time in a particular thread, its initialValue() method is called to determine the initial value of the threadvar in the current thread. This means that threadvars are only initialized when necessary, and you can easily add the required initialization code separately for every threadvar as needed.
The problem is that we don't have a Pascal language-level construct that maps to this mechanism (on other FPC targets, the initialization of system unit threadvars for I/O etc happens via some RTL-internal routines that we call whenever a new thread is registered with the RTL), and I'm not yet sure how to solve that.
Jonas _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel