Print

Print


While this is true, sadly C isn't going to give you any better time 
accuracy if it's running on a normal computer.  The bigger killer that 
many people are going to run into isn't whether or not a given language 
has garbage collection hamming up their processing but the fact that 
stimulus presentation is being done from a desktop computer.  The 
variety of background processes doing different things at different 
times, like looking for updates or checking the status of your IRQ's are 
all going to have to be factored into your timing.  A real solution 
would be to use a real time hardware / OS solution (linux is not an real 
time OS, nor it windows or mac), however the costs related to doing this 
are usually prohibitively expensive and the constraints of real time 
environments make things like video based stimulus presentation 
difficult or impossible.  Sadly this doesn't really answer your question 
but presents more of a rabbit hole filled with embedded computing 
hardware (thou.. some of that hardware is java based).
-Garrrett

Juanjo Lull (UPV) wrote:
> Dear Mathieu,
> Java is not a low-level language such as C. Thus, the time accuracy is 
> quite less stringent than the time accuracy present in other 
> programming languages. Furthermore, garbage collection (i.e. 
> destruction of variables because they are not being currently used) 
> can happen at any time by default.
> So the short answer is that Java does not guarantee time accuracy. It 
> is an excellent programming language for object oriented programming, 
> but it is not the best option: Workarounds can be done, but it is very 
> difficult to work with Java when synchronization is of high priority 
> anyway.
> I hope this helps.
> Yours sincerely,
> Juan J.
>
> Mathieu d'Acremont wrote:
>> Dear All,
>>
>> I would like to use the Java Programming Language to display stimuli 
>> and record response in a fMRI study (and then of course use SPM to 
>> analyze the data). I wonder how synchronization with the scanner can 
>> be done with Java an if Java guarantee time accuracy. Does anybody 
>> have experience with Java in fMRI experiment?
>>
>> Best,
>>
>