[sv-ec] Seeding $urandom and $urandom_range

From: Neil Korpusik <Neil.Korpusik_at_.....>
Date: Thu Nov 15 2007 - 16:48:05 PST
<forwarding bounced email from non-member Gopikrishna Kamisetty>


-------- Original Message --------
Date: Thu, 15 Nov 2007 06:38:14 -0600 (CST)
Subject: Seeding $urandom and $urandom_range
From: "Gopikrishna Kamisetty" <kgopi@syschip.com>
To: sv-ec@server.eda.org


The $urandom function is similar to the $random system function, with two
exceptions: $urandom returns unsigned numbers and is automatically thread
stable.

Example for thread stable
Code:

fork
begin process::self.srandom(100); x = $urandom; end
begin y = $urandom; process::self.srandom(200); end
join


Example of using seed according to syntax.
Code:

seed = 10
fork
begin x = $urandom(seed); end
begin y = $urandom(seed); end
join

1) From above examples, If seed is given by $urandom(seed), it is not
thread stable. If it is seeded by srandom(seed), then it is thread stable.
Is it correct?
2) Did not find anything in LRM about seeding $urandom_range(); Is it
possible to seed $urandom_range();


Regards,
Gopi Krishna


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Nov 15 16:48:42 2007

This archive was generated by hypermail 2.1.8 : Thu Nov 15 2007 - 16:48:51 PST