|
Posted by Jim Michaels on 04/26/06 00:26
"fletch" <richard.a.fletcher@googlemail.com> wrote in message
news:1145865073.709693.178550@i40g2000cwc.googlegroups.com...
> Well, don't seed based on time. Use getmypid() as part of the seeding.
> Perhaps you could get the two processes aware of each other, or aware
> of the last choice made.
>
found out that the database is an excellent source of random numbers if you
are stuck doing <img src=img.php...>
Also discovered that my host's apache configuration might be load PHP as an
..SO module under UNIX, therefore PHP *might* not get its own PID. If UNIX
..SO's are anything like Windows DLL's, only Apache has the PID - PHP
wouldn't even be a child process - it is simply allocated a chunk of memory
for its functions to load in.
If this were a CGI, then it would definitely get its own PID, but PHP.net
doesn't recommend this method of configuration.
To be honest, I haven't tried getmypid() after discovering that the URL on
src= needs to be unique so that the image isn't cached and therefore
duplicated. Now that I've got everything working, maybe I'll give it one
more go just to find out.
[Back to original message]
|