> ------------------------------ > > Date: Wed, 9 Aug 2000 00:55:40 -0700 > From: David Schleef <[EMAIL PROTECTED]> > Subject: Re: [rtl] generating random numbers > > On Wed, Aug 09, 2000 at 12:58:20PM +0700, Adi Sudewa wrote: > > > > Hi all, > > > > how to generate random integers from within real-time thread. > > I need to generate random numbers so my simulation can be > unpredictable. > > It is not cool to have a train running with 20.00 m/s speed > > all the time so I'd like to have the speed fluctuate round > 20.00 m/s. > > > The GNU Scientific Library has one of the finest collections > of PRNGs, from the trivially simple to ones capable of real > work, and then some capable of Real Work (tm). I'd pick a > relatively simple one and port it to RT. Unless there is a compelling reason to have this in the real time task, I'd calculate the random numbers in a user program and write them to the real-time task via a rtl FIFO. I've sent two channels of D/A data at 240 Hz with some really lame hardware (DT2801) using this method. Its clean, versatile and works well. You can get "real" random numbers by hooking a white noise generator to the sound card (or A/D if you have one) and reading it. --wally. -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] --- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
