PHP Threading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Graham Weldon

    PHP Threading

    Has anyone got any information or links for some tutorials on threading with
    PHP?
    I was looking at running a socket listener, and launch off new threads, and
    co-ordinate as requests come in.

    Cheers,
    Graham

  • Jerry Stuckle

    #2
    Re: PHP Threading

    Graham Weldon wrote:
    Has anyone got any information or links for some tutorials on threading
    with PHP?
    I was looking at running a socket listener, and launch off new threads,
    and co-ordinate as requests come in.
    >
    Cheers,
    Graham
    Graham,

    The PHP cli doesn't support multithreading. You can get multiple
    threads if you're running as an Apache or IIS extension and the
    webserver is running multiple threads, but that's all.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Benjamin

      #3
      Re: PHP Threading

      On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
      Graham Weldon wrote:
      Has anyone got any information or links for some tutorials on threading
      with PHP?
      I was looking at running a socket listener, and launch off new threads,
      and co-ordinate as requests come in.
      >
      Cheers,
      Graham
      >
      Graham,
      >
      The PHP cli doesn't support multithreading. You can get multiple
      threads if you're running as an Apache or IIS extension and the
      webserver is running multiple threads, but that's all.
      That's not completely true. You can the Process Control Functions
      (http://www.php.net/manual/en/ref.pcntl.php). However, they're only
      avaible on Unix like systems.
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstuck...@attgl obal.net
      =============== ===

      Comment

      • Chris Hope

        #4
        Re: PHP Threading

        Benjamin wrote:
        On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
        >Graham Weldon wrote:
        Has anyone got any information or links for some tutorials on
        threading with PHP?
        I was looking at running a socket listener, and launch off new
        threads, and co-ordinate as requests come in.
        >>
        >The PHP cli doesn't support multithreading. You can get multiple
        >threads if you're running as an Apache or IIS extension and the
        >webserver is running multiple threads, but that's all.
        >
        That's not completely true. You can the Process Control Functions
        (http://www.php.net/manual/en/ref.pcntl.php). However, they're only
        avaible on Unix like systems.
        That's process forking, which isn't quite the same as multi-threading.
        However it can be extremely useful depending on your requirements.

        --
        Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

        Comment

        • Jerry Stuckle

          #5
          Re: PHP Threading

          Benjamin wrote:
          On May 20, 8:55 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
          >Graham Weldon wrote:
          >>Has anyone got any information or links for some tutorials on threading
          >>with PHP?
          >>I was looking at running a socket listener, and launch off new threads,
          >>and co-ordinate as requests come in.
          >>Cheers,
          >>Graham
          >Graham,
          >>
          >The PHP cli doesn't support multithreading. You can get multiple
          >threads if you're running as an Apache or IIS extension and the
          >webserver is running multiple threads, but that's all.
          That's not completely true. You can the Process Control Functions
          (http://www.php.net/manual/en/ref.pcntl.php). However, they're only
          avaible on Unix like systems.
          Yes, but those are for multiple processes, not threads. PHP doesn't
          support multi-threading.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          • Brendan Gillatt

            #6
            Re: PHP Threading

            On Mon, 21 May 2007 11:46:36 +1000, "Graham Weldon"
            <graham@weldon. ath.cxwrote:
            >Has anyone got any information or links for some tutorials on threading with
            >PHP?
            >I was looking at running a socket listener, and launch off new threads, and
            >co-ordinate as requests come in.
            >
            >Cheers,
            >Graham

            PHP isn't good at all for threading - you'd be better of luanching a
            Python, Perl or C app from CGI instead.
            Brendan Gillatt

            GPG: 0x6E265E61

            Comment

            • Benjamin

              #7
              Re: PHP Threading

              On May 21, 12:44 pm, Brendan Gillatt
              <bren...@brenda nREMOVETHISgill att.co.ukwrote:
              On Mon, 21 May 2007 11:46:36 +1000, "Graham Weldon"
              >
              <gra...@weldon. ath.cxwrote:
              Has anyone got any information or links for some tutorials on threading with
              PHP?
              I was looking at running a socket listener, and launch off new threads, and
              co-ordinate as requests come in.
              >
              Cheers,
              Graham
              >
              PHP isn't good at all for threading - you'd be better of luanching a
              Python, Perl or C app from CGI instead.
              Or Java
              Brendan Gillattwww.bren dangillatt.co.u k
              GPG: 0x6E265E61

              Comment

              Working...