Hi Wilbert

Thanks for responding. However I am completely aware of how objects work as
I come from a Java back ground.
If you are familiar with Java at all I'm looking for something like the
PipedOutputStream, PipedInputStream and Thread classes

I want the processes objects to be threaded, therefore processing
simultaneously.
This would mean $c would print first as it slept for the least amount of
time.

All I'm really asking is how do you initiate threading with PHP?
A small example would be nice

Regards

Kris


----- Original Message -----
From: "W. Enserink" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 9:29 PM
Subject: Re: [PHP] Threading objects


> i'm not sure what you want. But you have created objects here in $a,$b and
> $c.
> If you want to order them in a special way you have to write the
> functionality of course. I think you have to do this before the object is
> created because you define the variables 10,5,1 before the objects are
> created. Once the objects are created they themselves don't know nothing
> form each other. So th eparent object has to control this, or in your case
a
> 'parent piece of script'.
>
> You can use $a,$b,and $c as regular,ordinary variables.  further on.
>
> hope it helped,
>
> Wilbert
>
> ----- Original Message -----
> From: "Kris" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 12, 2003 12:18 PM
> Subject: [PHP] Threading objects
>
>
> > I want to be able to thread objects. I'm not really sure at all where to
> > start. but I want a script where multiple objects are being processed at
> the
> > same time.
> > I have an example php script
> >
> > <?
> >
> > $a = new sleeper();
> > $b = new sleeper();
> > $c = new sleeper();
> >
> > $a->sleepFor(10);
> > $b->sleepFor(5);
> > $c->sleepFor(1);
> >
> > class sleeper {
> >
> >  function sleepFor($num) {
> >   sleep($num);
> >   echo "sorry I was a sleep for $num \r\n";
> >  }
> >
> > }
> >
> > ?>
> >
> > I want so object $c would print then object $b then object $a as the
> > sleeping time is less and less.
> > Does that make sense? Please ask if you don't understand
> >
> > Thanks for any help you can offer what so ever.
> >
> > Kris
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to