Skip to content

Commit e4f7d99

Browse files
WIP
1 parent e71f337 commit e4f7d99

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/Crusse/JobServer/Server.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,26 @@
3838
3939
-----------------------------------------------------------
4040
41-
Non-blocking i/o:
41+
Non-blocking i/o (perfectly synchronized):
42+
43+
worker1: 2ms to finish
44+
worker2: 2ms to finish
45+
worker3: 2ms to finish
46+
47+
server reads result: 0.5ms (r)
48+
server writes new job: 0.5ms (w)
49+
cpu time available for extra non-i/o work: (+)
50+
waiting for i/o: (.)
51+
52+
time: 0 1 2 3 4 5 6 7
53+
worker1: r++r++r++w++w++w r++r++r++w++w++w
54+
worker2: r++r++r++w++w++w r++r++r++w++w++w
55+
worker3: r++r++r++w++w++w r++r++r++w++w++w
56+
server: ++++++++++
57+
58+
-----------------------------------------------------------
59+
60+
Non-blocking i/o (not synchronized):
4261
4362
worker1: 3ms to finish
4463
worker2: 2ms to finish
@@ -156,7 +175,6 @@ private function createServerSocket() {
156175

157176
if ( !$this->serverSocket )
158177
throw new \Exception( 'Could not create a server: ('. $errNum .') '. $errStr );
159-
160178
}
161179

162180
private function createWorkerProcs( $count ) {
@@ -175,7 +193,6 @@ private function createWorkerProcs( $count ) {
175193
$workers[] = $process;
176194
}
177195

178-
179196
$this->workerProcs = $workers;
180197
}
181198

0 commit comments

Comments
 (0)