I do agree that C is much faster (it's what i prefer writing in, I live
in matlab based on requirement). My point was just that you still can't
guarantee the timing without doing 'bad stuff' to the OS. This is my
understanding for why E-Prime chokes in vista, since afore mentioned bad
stuff no longer works. I could be wrong granted, but my understanding
is the stuff they are doing is rather 'bad'(like.. kernal hacking bad).
E-Prime also uses DirectX to get closer to the bare metal, and 2.0 costs
a pretty penny (we just got a 10 seat copy for the price of our
departments collective first borns) so I understand the desire to get
around having to purchase something like that.
:so: my really point was: The OS is still going to be a clincher for
alot of people but you can tweak it to prevent some of that stuff. In
windows for instance using a hardware profile with all but the bare
bones services turned off and no startup programs. This won't fix
everything as the scheduler still gives preference to the desktop but
it's going to get around alot of background tasks running. Using an
embedded solution would avoid this entirely but at the cost of swaths of
functionality and significant development times(since you have no OS to
build against / around). So my suggestion is go with the OS, write in
C/c++ and hope the OS doesn't bite you in the butt too hard. sorry if
that wasn't clear the first time around :/
-Garrett
Pieter Vandemaele wrote:
> Just my 5 cent of comments: Is there any reason why you want to use
> Java? As Juan states, Java is high level and is developped for cross
> platform applications for Sun, PC, Mac, Palm, PDA, ...Timing accuracy
> was not a key issue in the development of Java. On the other hand, I
> oppose Garrett a little (sorry :-) ): a complete real time operating
> system is not necessary for millisecond accuracy (which is default for
> cognitive science) and C really is faster then Java on a normal PC.
> The C compiler generates machine code directly, the Java compiler
> generates bytecode, which has to be interpreted by the Java Virtual
> Machine, which converts the bytecode to machinecode and slows down the
> application. If you really want to go hard real-time, you should write
> your application in eg ADA.
> There are some tools like Presentation and E-Prime which emulate the
> best of both worlds and which have very good timing characteristics.
> However, this costs you a little money, but you can start your fMRI
> experiments right away and adds faster to you CV then first writing
> you own program.
> A freeware alternative is Cogent
> (http://www.vislab.ucl.ac.uk/Cogent/index.html) which is quit
> extensive and which runs on Matlab (which you already have because you
> mail to the SPM mailing list ;-) ). Try it and maybe you'll like it,
> it's a matter of taste.
> I hope this can help you a little, I am always available for discussion.
>
> Pieter
>
>
> Garrett McGrath schreef:
>> 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,
>>>>
>>>
>
|