FAQ
Hi guys, long time reader, 2nd time poster. I realize there is
much...bitterness about multithreading in PHP. I feel it is important,
but I know others don't. I just wanted to write and say that I have made
Moriyoshi Koizumi's php_threading (
http://github.com/moriyoshi/php-src/blob/PHP_5_3-threading/ext/threading/ )
available for Windows!

I converted all of the code to pthreads instead of GNU Pth so that
pthreads-win32 could be used on Windows. I am quite proud to say that
converted it all from Pth to pthreads by only reading the documentation
and never actually building it with GCC--and it worked the first time.
Well, not quite, but those were just dependency and other errors (like
that stupid 32 bit time thing)--all the pthreads stuff worked first time
(that is the first time I have said that about anything C related :D)! I
just converted it all in good ol' Notepad++ and then made VC2008 project.


QUICK REPO, SOURCE AND BINARY LOCATION
--------------------------------------
My repo is at: http://github.com/alecgorge/php_threading

I push the compiled DLL so you can always find the latest compiled
version at:
http://github.com/alecgorge/php_threading/tree/master/binaries/Release/

If you are interested in a "stable" version I will post them at:
http://github.com/alecgorge/php_threading/downloads


HELPING
-------
For those of you interested in helping, go ahead! The repo has
everything you need to build except for the Windows SDK and VC2008. It
has all the PHP headers, PHP libraries, pthreads-win32 headers and
pthreads-win32 libraries you need to compile yourself (in the deps folder).

Now for the bad part: it is really ****ing buggy. For example: most of
the samples work. Some never exit. Some crash. But overall it is
"stable" enough just to use for a quick personal project with PHP.

I think the biggest bug is that usleep breaks (whoops).


Here is my comments by sample (found in source/samples/)
--------------------------------------------------------
01: Works well except for the crashing at the end.
02: Doesn't work at all. But I have never worked with sockets in PHP so
maybe someone wants to lend a hand?
03: Goes with example02. Doesn't work at all and I have no clue why.
04: Demos sending content to threads. It works except it never exits!


What I would like:
------------------
- Someone with real experience working with threads and C to give me a
hand tracking down some of the bugs. I am willing to fix things myself
but I am having trouble locating things!

- Linux people to help me out. I have no Linux box handy so tell me if
this build works with Linux. I tried to make sure I didn't break
anything by using conditional comments--and I think it works? (see:
http://github.com/alecgorge/php_threading/blob/master/source/threading.c#L369
for an example)

- Linux people to give me build instructions. You can see Moriyoshi's
original instructions at
http://github.com/moriyoshi/php-src/blob/PHP_5_3-threading/ext/threading/README



Sorry for the wall of text, I just had a very productive 12 hours of
coding and wanted to tell the world :D

-Alec

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedAug 23, '10 at 3:12a
activeAug 24, '10 at 11:33p
posts3
users1
websitephp.net

1 user in discussion

Alec: 3 posts

People

Translate

site design / logo © 2022 Grokbase