A PHP Extension for REAL threading

Specialized forum concerning the development and building of the WinBinder library.

Moderator: rubem

Re: A PHP Extension for REAL threading

Postby alecgorge » Wed May 19, 2010 2:58 am

I am hoping that the bcompiler extension has examples of what I can do.
phpack, the best PHP compiler ever (unicode support): http://bit.ly/d1PXGF
alecgorge
 
Posts: 220
Joined: Thu Dec 03, 2009 2:05 am

Re: A PHP Extension for REAL threading

Postby frantik » Wed May 19, 2010 3:03 am

try this around line 426 in threads.c.. i just compiled it and it didnt break anything.. havent tested it with res yet though

Code: Select all
zend_stream_open(script_file, &file_handle TSRMLS_CC);
   /*file_handle.handle.fp = VCWD_FOPEN(script_file, "rb");
   file_handle.filename = script_file;                       
   
   file_handle.type = ZEND_HANDLE_FP;
   file_handle.opened_path = NULL;
   file_handle.free_filename = 0;*/


might need to disable the line SG(request_info).path_translated = script_file; if it messes with the path.. dunno


edit: well it worked with the file:// wrapper so it's looking promising

weird it only works like "most of the time" with the file wrapper.. sometime it says the filename can't be empty.. weird
frantik
 
Posts: 595
Joined: Tue Mar 22, 2005 7:17 am
Location: California

Re: A PHP Extension for REAL threading

Postby frantik » Wed May 19, 2010 5:35 am

well it didn't really work with res lol.. and really not with bcompiler

the thread include function needs to support BOTH otherwise it's of limited use :\

php_stream_open_wrapper look promising..
frantik
 
Posts: 595
Joined: Tue Mar 22, 2005 7:17 am
Location: California

Re: A PHP Extension for REAL threading

Postby alecgorge » Wed May 19, 2010 11:27 am

I think we are better suited to making thread_start work. It would prove much more useful than thread_include. Imagine:
Code: Select all
thread_start(function ($arg1, $arg2) {
     echo "Threaded? NO WAY."
}, array($arg1, $arg2));
phpack, the best PHP compiler ever (unicode support): http://bit.ly/d1PXGF
alecgorge
 
Posts: 220
Joined: Thu Dec 03, 2009 2:05 am

Re: A PHP Extension for REAL threading

Postby frantik » Wed May 19, 2010 5:00 pm

if you look at the code for thread_start you can see it also loads a file from disk but it doesnt even work at all so it's even MORE work than getting thread_include to work
frantik
 
Posts: 595
Joined: Tue Mar 22, 2005 7:17 am
Location: California

Re: A PHP Extension for REAL threading

Postby ermac2014 » Wed May 19, 2010 6:24 pm

I wish rubem can help you guys with this :(
imagine winbinder apps with multithreading support that will be a kill...
ermac2014
 
Posts: 270
Joined: Wed Jan 13, 2010 8:44 pm

Re: A PHP Extension for REAL threading

Postby alecgorge » Wed May 19, 2010 10:29 pm

in thread_start it loads the file it is called from. I will play around with it, maybe even remove that section.

edit: duh, i can't remove that section! it is in a different thread, so i needs a new op_cache array.
phpack, the best PHP compiler ever (unicode support): http://bit.ly/d1PXGF
alecgorge
 
Posts: 220
Joined: Thu Dec 03, 2009 2:05 am

Re: A PHP Extension for REAL threading

Postby frantik » Thu May 20, 2010 1:54 am

yeah...

i emailed the developer of bcompiler to see if he had any insight on how to make the extension load bcompiled files... im hoping maybe it will help with streams too
frantik
 
Posts: 595
Joined: Tue Mar 22, 2005 7:17 am
Location: California

Re: A PHP Extension for REAL threading

Postby frantik » Thu Aug 19, 2010 2:44 am

here are the files i was using... i don't really remember what i did, but i think i got threading from other files working.. but i'm not super sure

includes some php files, the dll and VC project

http://swiftlytilting.com/downloads/php ... rantik.zip
frantik
 
Posts: 595
Joined: Tue Mar 22, 2005 7:17 am
Location: California

Previous

Return to C Programming