Reply to Re: php 5 extension concurrency

Your name:

Reply:


Posted by Steve on 03/06/07 14:37

"thomas" <thomas_bagnino@hotmail.com> wrote in message
news:part1of1.1.7mnbZt2VDWEsFA@ue.ph...
| Hi,
|
| I'm writting an extension in c for php. Looking at the life cycle of the
| extensions it looks like each extension is started up within its own
thread -
| is this correct?

it depends on what os you're running it on. linux and windows have different
aproaches to threading and process space. it also depends on how you write
your c code (which can be accessed across different processes and
threads...if you make it so).

| When each request comes in for the extension is seperate thread then
handling
| the request? My problem is that I would like to obtain a unique id in a c
| function in the extension, which would be used in conjunction with a
message
| queue for IPC, but I'm not sure how the concurrency works in the php
framework.

it is os dependent. why not test your theory be putting an interface in your
lib that essentially returns the thread id? not only would that answer your
question, it could also be used as your unique id.

| The basic extension should send a message to message queue when a request
comes
| in and the message should contain a unique id to identify the request in
order
| for the message server to send a response to the correct request.

why not just make this simple and use a db? there's your unique id and
messaging queue no matter what process or thread. if you must though, and
you're on windows...have your c code create a named-pipe with a static path.
that would be accessible accross threads and process space as well.

| is there any reason for why this shouldn't be possible?

tons...mostly ones own lack of experience or imagination.

| Any help or links would be greatly appriciated.

if you described what you were trying to do, what the functional
requirements are, and what os's you are intending to support, we would be of
greater service.

[Back to original 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

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