r/programming • • Feb 24 '13

Ruby 2.0.0

http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/
600 Upvotes

193 comments sorted by

View all comments

Show parent comments

1

u/TikiTDO Feb 24 '13 edited Feb 24 '13

I'll see if I can find it, but this was a small proof of concept project I did years ago just to see if it was possible (Open multiple connections, then echo text typed in one to all the others), so it's probably in some archive in a deep corner of my backup drive.

More specifically, the program was actually multi-process, not multi-threaded. I remember abusing shared memory, and generally doing things that most would not associate with PHP in order to overcome the limitations of the language. I also recall that I had a busy loop for some reason, and that the server broke my networking if I didn't shut it down properly, though that was just me being lazy with connection management. These days I think they've implemented proper native threading in PHP, so I imagine you could do what I did back then with significantly less hackery.

2

u/[deleted] Feb 24 '13

These days I think they've implemented proper native threading in PHP

That's the part I'm interested in. I didn't think it was possible to do true multithreading in PHP.

1

u/TikiTDO Feb 24 '13

Take a look at PHP pthread.

1

u/[deleted] Feb 24 '13

Unfortunately, pthread is POSIX-only so you can't use it if you want your code to be portable to non-POSIX operating systems (i.e. Windows).

→ More replies (0)