Re: rand() in while in kernel mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 21, 2002 at 10:20:28PM -0800, William Lee Irwin III wrote:
> On Fri, Feb 22, 2002 at 08:04:01AM +0200, Tomas Ukkonen wrote:
> > Yes, that's probably the right way to do it. I was just wondering if
> > there's some reason why I shouldn't. Drivers/net/hamradio/yam.c
> > generates its own random numbers. Does anyone know why it does that or
> > is it just sloppy coding?
> 
> There's probably no reason why a per-instance seed and a cookbook
> pseudorandom number generator (e.g. Park-Miller) won't suffice. Most
> of these rand()s don't require more than a few machine words of state.

And if you wonder where to look for C implementations: get "Numerical
Recipes in C". It's even freely available online at http://www.nr.com/ .


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux