Your SlideShare is downloading. ×
PHPのすべらない話#3
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

PHPのすべらない話#3

1,851
views

Published on

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,851
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. <?php function sub($i, $ch) { for (;;) { $a = <- [$ch]; printf("%d:%dn", $i, $a); } } $ch = thread_message_queue_create(); for ($i = 0; $i < 10; $i++) { thread_create('sub', $i, $ch); } $i = 0; for (;;) { [$ch] <- ($i++); usleep(50000); } ?>
  • 2. <?php function sub($i, $ch) { $ch for (;;) { $a = <- [$ch]; printf("%d:%dn", $i, $a); $ch} } $ch = thread_message_queue_create(); for ($i = 0; $i < 10; $i++) { thread_create('sub', $i, $ch); $ch } $i = 0; for (;;) { [$ch] <- ($i++); usleep(50000); } $ch ?>