trinistorm Posted November 14, 2010 Share Posted November 14, 2010 Does anyone know of a good tutorial or article that can show me the way to using threading in php?I have a couple of php classes and I want to create a sort of logger so that when each class is called the logger dumps what they are doing from memory to a text file or network stream etc.Thanks Link to comment Share on other sites More sharing options...
boen_robot Posted November 14, 2010 Share Posted November 14, 2010 There's no real threading in PHP.On UNIX systems, there's pcntl_fork(), which forks the current process. Forking is similar to threading, but it executes the same program (with a different process ID, on a different CPU thread I'd assume) instead of a sub program (as JAVA or .NET threads work).For Windows, there's nothing (yet). Link to comment Share on other sites More sharing options...
trinistorm Posted November 14, 2010 Author Share Posted November 14, 2010 Thanks boen. I'm going to use serialization instead when I need to write to the log. More work though, I was hoping to periodically dump the contents of main memory to a text file. I'm trying to keep my scripts platform independent so pcntl_fork() might not help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.