Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Request for Threads or SRM [RSS Feed]

#1 Nov. 24, 2005 18:26:12

D. D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


All,I have been trying to use PHP 5.0.5 for all my programming tasksincluding replacing many stand-alone Java servers. I've been successfulto a degree, but I'm seriously missing Java Threads. I've written somecode which uses SHM, Sockets, IPC, and PCNTL, but it's not as clean androbust as it should be.Since the jury is still deliberating over PHP6 and what it will offer,I'd like to put in my request to have a native PHP Thread object. IfThreads are too much to tackle, it would be nice to have something likeSRM (Script Running Machine) which could be used for CLI environmentstand-alone servers.-- D. Dante Lorenso

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Nov. 24, 2005 18:40:28

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


D. Dante Lorenso wrote:All,I have been trying to use PHP 5.0.5 for all my programming tasksincluding replacing many stand-alone Java servers. I've been successfulto a degree, but I'm seriously missing Java Threads. I've written somecode which uses SHM, Sockets, IPC, and PCNTL, but it's not as clean androbust as it should be.Since the jury is still deliberating over PHP6 and what it will offer,I'd like to put in my request to have a native PHP Thread object. IfThreads are too much to tackle, it would be nice to have something likeSRM (Script Running Machine) which could be used for CLI environmentstand-alone servers.That's way outside the scope of what we have planned for PHP 6 and I canpretty much guarantee it won't happen. The SRM-like thing doesn't needto be part of PHP though. Anybody can build such a beast.-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Nov. 24, 2005 19:02:54

Leonardo P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


On Thursday 24 November 2005 15:39, Rasmus Lerdorf wrote:
> D. Dante Lorenso wrote:
> > All,
> >
> > I have been trying to use PHP 5.0.5 for all my programming tasks
> > including replacing many stand-alone Java servers. I've been successful
> > to a degree, but I'm seriously missing Java Threads. I've written some
> > code which uses SHM, Sockets, IPC, and PCNTL, but it's not as clean and
> > robust as it should be.
> >
> > Since the jury is still deliberating over PHP6 and what it will offer,
> > I'd like to put in my request to have a native PHP Thread object. If
> > Threads are too much to tackle, it would be nice to have something like
> > SRM (Script Running Machine) which could be used for CLI environment
> > stand-alone servers.
>
> That's way outside the scope of what we have planned for PHP 6 and I can
> pretty much guarantee it won't happen. The SRM-like thing doesn't need
> to be part of PHP though. Anybody can build such a beast.
>
> -Rasmus

And threads? well I must say that with php-gtk for gui client apps and php in
general with all the objects engine as it is now, threads would turn it into
a really powerful development framework for everything.
Is there any research in the topic, or is it just sleeping waiting for the
right moment to be?

Leo


--

Leonardo Pedretti
Axon Sistemas
Líder de Equipo Proyecto Basalto

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 Nov. 24, 2005 19:20:23

Andreas K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


Rasmus Lerdorf wrote:That's way outside the scope of what we have planned for PHP 6 and I canpretty much guarantee it won't happen. The SRM-like thing doesn't needto be part of PHP though. Anybody can build such a beast.What about something like a "persistent superglobal"? The idea is tohave something like an application-wide session, not only a session peruser. There could be several backends, the same way likesession.save_handler setting for the session extension (e.g. files, mm,apc...).I have described that in more detail here:http://news.php.net/php.internals/19690Andrey posted an interesting response on how to use semaphore and shm,but I was thinking about hiding the implementation and add a supergloballike $_PERSISTENT (or something like that), which can store any PHPvariables between requests, like $_SESSION does, but application-wide,not separated for each user.best regards
Andreas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#5 Nov. 24, 2005 19:51:37

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


Andreas Korthaus wrote:Rasmus Lerdorf wrote:That's way outside the scope of what we have planned for PHP 6 and Ican pretty much guarantee it won't happen. The SRM-like thing doesn'tneed to be part of PHP though. Anybody can build such a beast.What about something like a "persistent superglobal"? The idea is tohave something like an application-wide session, not only a session peruser. There could be several backends, the same way likesession.save_handler setting for the session extension (e.g. files, mm,apc...).I have described that in more detail here:http://news.php.net/php.internals/19690Andrey posted an interesting response on how to use semaphore and shm,but I was thinking about hiding the implementation and add a supergloballike $_PERSISTENT (or something like that), which can store any PHPvariables between requests, like $_SESSION does, but application-wide,not separated for each user.That's already on the list. See section 6.9

-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#6 Nov. 24, 2005 20:03:49

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


Leonardo Pedretti wrote:On Thursday 24 November 2005 15:39, Rasmus Lerdorf wrote:D. Dante Lorenso wrote:All,

I have been trying to use PHP 5.0.5 for all my programming tasks
including replacing many stand-alone Java servers. I've been successful
to a degree, but I'm seriously missing Java Threads. I've written some
code which uses SHM, Sockets, IPC, and PCNTL, but it's not as clean and
robust as it should be.

Since the jury is still deliberating over PHP6 and what it will offer,
I'd like to put in my request to have a native PHP Thread object. If
Threads are too much to tackle, it would be nice to have something like
SRM (Script Running Machine) which could be used for CLI environment
stand-alone servers.That's way outside the scope of what we have planned for PHP 6 and I can
pretty much guarantee it won't happen. The SRM-like thing doesn't need
to be part of PHP though. Anybody can build such a beast.

-RasmusAnd threads? well I must say that with php-gtk for gui client apps and php ingeneral with all the objects engine as it is now, threads would turn it intoa really powerful development framework for everything.Is there any research in the topic, or is it just sleeping waiting for theright moment to be?I agree that for an event-driven standalone GTK app it would make sense.It starts to make less sense in a web application where a thread isreally a request. There are times when you want some asynchronousthings like being able to query 100 remote urls at the same time, or youmight want an asynchronous DNS lookup, but in most of these casesthreads aren't actually the best way to do that.If a patch comes along that implements it in a sane manner withoutcomplicating everything we will look at it of course. But among thecurrent core developers I don't think any of us need this so my guess isthat it would take an outside effort.-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#7 Nov. 24, 2005 20:04:25

Andi G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


You could use a system like memcached. This kind of thing isn'treally in the scope of doing it in PHP per-se.At 11:19 AM 11/24/2005, Andreas Korthaus wrote:Rasmus Lerdorf wrote:That's way outside the scope of what we have planned for PHP 6 andI can pretty much guarantee it won't happen. The SRM-like thingdoesn't need to be part of PHP though. Anybody can build such a beast.What about something like a "persistent superglobal"? The idea is tohave something like an application-wide session, not only a sessionper user. There could be several backends, the same way likesession.save_handler setting for the session extension (e.g. files,mm, apc...).I have described that in more detail here:http://news.php.net/php.internals/19690Andrey posted an interesting response on how to use semaphore andshm, but I was thinking about hiding the implementation and add asuperglobal like $_PERSISTENT (or something like that), which canstore any PHP variables between requests, like $_SESSION does, butapplication-wide, not separated for each user.best regards
Andreas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#8 Nov. 24, 2005 20:05:35

Andi G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


I thought 6.9 was per-process persistent

At 11:50 AM 11/24/2005, Rasmus Lerdorf wrote:Andreas Korthaus wrote:Rasmus Lerdorf wrote:That's way outside the scope of what we have planned for PHP 6 andI can pretty much guarantee it won't happen. The SRM-like thingdoesn't need to be part of PHP though. Anybody can build such a beast.What about something like a "persistent superglobal"? The idea isto have something like an application-wide session, not only asession per user. There could be several backends, the same waylike session.save_handler setting for the session extension (e.g.files, mm, apc...).I have described that in more detail here:http://news.php.net/php.internals/19690Andrey posted an interesting response on how to use semaphore andshm, but I was thinking about hiding the implementation and add asuperglobal like $_PERSISTENT (or something like that), which canstore any PHP variables between requests, like $_SESSION does, butapplication-wide, not separated for each user.That's already on the list. See section 6.9

-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#9 Nov. 24, 2005 20:08:54

Rasmus L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


Andi Gutmans wrote:I thought 6.9 was per-process persistentYeah, they are, but they are still in the same family, I think. If youhave a config.inc, for example, that populates a $config array. If youmake that persistent you only have to load it once and it will beavailable to each request from then on. Read-only application variablein a sense.And apc already implements apc_store/apc_fetch which does this in ashared manner.-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#10 Nov. 25, 2005 12:48:22

Sebastian B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Request for Threads or SRM


Andi Gutmans schrieb:
> You could use a system like memcached. This kind of thing isn't really
> in the scope of doing it in PHP per-se.

No, but PHP could provide a standardized frontend in the form of a
super-global that can have modular backends (like we have with
ext/session). One backend could then use memcached as its data store.

--
Sebastian Bergmannhttp://www.sebastian-bergmann.de/GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Request for Threads or SRM [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support