You are here: Re: generate 2 random numbers in rapid sequence « PHP Programming Language « IT news, forums, messages
Re: generate 2 random numbers in rapid sequence

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация