HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
krakjoe
pthreads
C2013–2023
krakjoe / pthreads · Archived

pthreads

Threading for PHP - Share Nothing, Do Everything :)

7Distinct people
7Mentions
0Explicit recommenders
3.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Threading for PHP - Share Nothing, Do Everything :)

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year7 dated mentions

Observed mentions: 2013-01-10 19:07:35 UTC to 2023-07-29 01:45:32 UTC.

01232013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC321
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

7 sources
The main benefit of the threadsafe builds was reentrancy support for multithreaded web servers (e.g. IIS / some apache MPMs). They were only slightly slower for single-threaded code. The new PHP 8 fibers are only coroutines on a single thread, but PHP has had fork/join since 2001 (!), which works pretty well with Linux CoW. There has been a pthreads extension since about 2012. However keeping a 1:1 pthreads API prevents some optimization possibilities [1], so the new hotness is php-parallel [2], which will transparently copy closed-over variables to a subinterpreter. 1. https://github.com/krakjoe/pthreads/issues/929#issue-4106367... 2. https://www.php.net/manual/en/philosophy.parallel.php
In Intent to approve PEP 703: making the GIL optional
> Why are you building arrays with mixed key types? It happens on accident. All keys are converted to ints if they can be. So if you read a file that is called "123", it'll suddenly become an int key whereas all the rest will be strings. That's absolutely insane. > Why do you want type hints? The same reason anybody does. It is a contract and it makes your code more well-documented, more robust, and more correct. There's a reason that PHP has typehints and the consensus in all major, current, PHP projects is that they are good. > Php has pthreads. They just arent needed that often. Pthreads is garbage. Always has been. Never worked on servers. Is deprecated, finally: https://github.com/krakjoe/pthreads/issues/929 https://www.php.net/manual/en/intro.pthreads.php > Async is being worked on You didnt mention it but immutable types are also b
Read the rest
eing worked on. PHP will be less awful when they're done. It's still awful today. I don't revel in PHP being bad. If it's good some day, I'll be happy. > Everything people complain about php over tends to actually make its way into the language eventually. 25 years. 25 years and the language still sucks. Just use Java (or better yet, Kotlin). > I dont know when you tried php, but I dont really think it was in earnest. It sounds like you had problems keeping your types straight. I've been doing PHP dev for years now. Of course I had trouble keeping my types straight. PHP turns everything into a string whenever it can. Except sometimes it turns strings into ints for some unholy reason. Also, the type system (like Java's) sucks. It's not expressive at all and I can't even return a collection of a single type without resorting to language extensions. > I agree its not super natural to deal with the php type system but once you learn it its pretty simple to keep things in order. Not being natural is not the same thing as being broken. And being able to remember all of the gotchas doesn't make it simple. > I see most messes arise when people mix types, mutate variables carelessly, or otherwise over leverage things they shouldnt (e.g. globals) Agreed. So how do we avoid mutation? Use `clone`? Nope. It's shallow and everything is mutable by default. Overload `__clone()` on every class you write? Okay, but you better hope that your classes don't have fields that DON'T implement deep cloning... > But these are hygiene problems, and all languages have these. Bull. No language is perfect. But tell me, what's worse: 1 issue or 1,000 issues? Come on. > Ive seen garbage java, ive seen hairballed rust, ive seen pretty much any c, ive seen wanky golang and ive seen babel-typescri-rea-tsx See above. This is the most bottom-of-the-barrel excuse I keep reading over and over. PHP ENCOURAGES garbage code. Rust does not. Not even in the same ballpark. Not even playing the same GAME. > The only thing that really annoys me about php these days is the dollar signs. lol
In 25 Years of PHP
agtunn·Sep 25, 2013Submission

PHP Application Server based on pthreads

Joe Watkins introduced the PECL extension "https://github.com/krakjoe/pthreads" half a year ago (thanks Joe, great job), opening the way for appserver.io, the first thread base solution in PHP that will provide real application server functionality like JBoss in the Java ecosystem. appserver.io is an open source project with the goal of creating a stable, scalable and high performance platform to provide PHP developers services that are needed in virtually all major projects. At this point of time it is possible to use the Servlet Engine (Webserver), the Persistence Container (Doctrine) and the MessageQueue. As the development is still in a very early stage, we do not recommend the usage on a live system. All Components are entirely developed with PHP and can be downloaded together with some example Applications (e. g. Magento CE) "". The
Read the rest
components are also available as Composer bundle. Altogether this means that a developer can easily access the components, expand and adjust them if needed. For easy start up, we provide you with a package for Mac OS X 10.8.x as well as a Debian-Wheezy-package, available at ."http://www.appserver.io", however please keep in mind, PHP must be compiled thread-safe. The latest version can be installed and tested conveniently using the Debian Repository deb.appserver.io. The bundle includes a system independent PHP Stack and an application demo. Install the Application first before opening http://localhost:8586/demo in a browser. The existing documentation is still very rudimentary but will be updated and improved over the next weeks to provide a simple and easy entry for the basics. Stay tuned and make sure to read the article that will come out with the next PHP magazine. The article will help the interested developers to find an starting point for developing with PHP and threads.
6 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.