User Profile

Collapse

Profile Sidebar

Collapse
gr4v3n
gr4v3n
Last Activity: Sep 20 '10, 08:49 PM
Joined: Sep 18 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • LOL. I know what an if else clause do. But in this case both should print. When fork is called the process divides in two processes. The first process is the parent and so it prints when IF clause(because $pid in this case will be the pid of the child so it's bigger thank zero. The second is the child so it prints when ELSE clause(the $pid in this process is 0). They both print, that program is a simple test to multiprocessing .

    Anyway...
    See more | Go to post

    Leave a comment:


  • Code:
    Rizladonovich      Well, your control-flow does not allow more than one statement to be printed, as is correct.
    I'm sorry I'm kind of a new but what does this mean? In the browser only one of them writes but php in cli both write like when I used C. Is this a problem because of the browser. My idea was to open a new page, fork the process, terminate the parent and let the child live as a deamon in order to keep aquiring data from serial...
    See more | Go to post

    Leave a comment:


  • gr4v3n
    started a topic pcntl_fork suport instaled but not working correctly
    in PHP

    pcntl_fork suport instaled but not working correctly

    Greetings.
    First of all I must apologyse for my english.

    I have used multi processing before in C but know I have a project that it would be usefull to use it in php.

    Here comes the problema I installed php support for pcntl_fork and when running a simple test program It does not work correctly.


    Code:
     $pid = pcntl_fork();
      if ($pid != -1) {
        if ($pid) {
          print "In the
    ...
    See more | Go to post
    Last edited by Niheel; Sep 18 '10, 10:31 PM.
No activity results to display
Show More
Working...