You are here: Re: How PHP Session ID is proved to be unique? « PHP Programming Language « IT news, forums, messages
Re: How PHP Session ID is proved to be unique?

Posted by David T. Ashley on 06/23/07 19:42

"howa" <howachen@gmail.com> wrote in message
news:1182614984.507891.134810@i38g2000prf.googlegroups.com...
> On 6 23 , 11 35 , "David T. Ashley" <d...@e3ft.com> wrote:
>> The particular approach I use to ensure uniqueness is to concatenate
>> time,
>> microtime, and PID, and then to spinlock until the microtime changes.
>> This
>> works because no two processes can have the same PID at the same time.
>
> yes, your method seem more reliable than PHP implementation...
> but will it work on multi-thread web server, e.g. apache2?

My understanding would be that it won't work if a server is truly
multi-threaded.

My assumption is that each process is single-threaded, and that the http
server farms things out so that each PHP script running at any instant in
time has only one PID.

If threads are involved, that complicates things.

One would then need to use a different method entirely or also add some kind
of a thread identifier.

Dave.
--
David T. Ashley (dta@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)

 

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

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