Synchronized methods generated by compile_to_java
Colin Paul Adams <[email protected]> 04 Aug 2005 22:26:27 +0100
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
I'm aware that compile_to_java is not working yet. I was wandering how the compiler will decide for which routines to generate synchronized policies. Three possible strategies spring immediately to my mind: 1) No routines are synchronized. 2) All commands are synchronized but no queries are. 3) All routines are synchromized. and I expect more complex policies could be devised. The reason I'm speculating, is that I have been observing that Saxon (an XSLT processor written in Java) gets a free performance boost when running on an SMP machine, in as much as the JVM is apparently parallelising execution in some way - it uses more than one CPU, yet there is no multi-threading present in the Saxon code. I presume that the JVM will not parallelise execution of synchronised routines, which lead me to think of this subject. Does Smarteiffel support any multi-threading of any kind? As far as I know, it doesn't, in which case (1) might reasonably be selected as a valid strategy. But if the JVM is then going to multi-thread under the covers, it might be disastrous. (2) looks safe, but then I have to worry about memo functions. (3) is certainly safe, but it would be a pity to loose a free performance boost. Am I making any sense? -- Colin Adams Preston Lancashire