nerdexam
Zend

200-710 · Question #4

Consider 3 PHP files that are called asynchronously via XMLHttpRequest: // s1.php session_start(); sleep(1); // s2.php session_start(); sleep(2); // s3.php session_start(); sleep(3); Which of the…

The correct answer is A. The total execution time for all 3 requests will be the maximum of the longest sleep() call. See the full explanation below for the reasoning.

State Management

Question

Consider 3 PHP files that are called asynchronously via XMLHttpRequest: // s1.php session_start(); sleep(1); // s2.php session_start(); sleep(2); // s3.php session_start(); sleep(3); Which of the following statements is true? (Choose two.)

Options

  • AThe total execution time for all 3 requests will be the maximum of the longest sleep() call
  • BThe requests may be processed out of order
  • CThe requests are guaranteed to be executed in order
  • DConcurrent requests will be blocked until the session lock is released

How the community answered

(46 responses)
  • A
    80% (37)
  • B
    2% (1)
  • C
    11% (5)
  • D
    7% (3)

Topics

#session locking#concurrent requests#XMLHttpRequest#session_start

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice