[clug] Appropriate language for a task...

Robert Edwards bob at cs.anu.edu.au
Mon Sep 1 07:26:34 GMT 2008


You can recompile the kernel with the system clock running at 1kHz,
if you need to be able to schedule events to occur with millisecond
accuracy (no guarantee that the kernel will actually run them when
you want, but most of the time, on an unloaded machine, it will).

Language of choice: C, with xlib etc. for your User Interface - can't
go wrong with that...

More reasonably, I would separate out the UI from the bit that needs
millisecond accuracy and run them on separate boxes with a UDP
messaging system running over an unloaded network between them.

You can write your UI in whatever takes your fancy on the machine
doing the UI.

Definitely don't connect the machine requiring millisecond timing
to the Internet, or any network without a good firewall and no
broadcasting going on (use static ARP etc.). Network interfaces
are a great source of non-deterministic load. Also, avoid disks
and any journalling file-system - use UDP and/or syslog to send
data to another machine for capture and storage. Also, no graphics
and especially no mouse! (or keyboard, if possible). And no USB!

Cheers,

Bob Edwards.

David Tulloh wrote:
> You can't get timing guarantees on a modern PC without a lot of effort
> (have a look at the realtime Linux work).  The PC just isn't designed
> for it, garbage collection is a fairly small issue compared to the
> scheduler.
> 
> That said, a millisecond is a large time window to a processor so you
> should be able to get away without too much work depending on how
> critical the timing accuracy is to your application.
> 
> 
> David
> 
> jm wrote:
>> You could turn GC off when needed.
>>
>> Jeff.
>>
>> Jason wrote:
>>> Never had to do something with millisecond accuracy though so don't
>>> know how well an interpreted language will cope with that, never know
>>> when those pesky garbage collectors are going to wake up or so I
>>> remember being told many years ago, might be fixed as an issue by now.
>>>
>>>   
> 



More information about the linux mailing list