Comments (9)
Should be fixed in latest commit, can you confirm ?
from pthreads.
let me take a look. maybe I'll send a patch for this.
from pthreads.
sorry, I can't find how to fix this problem. probably this extension should be compile with php on linux machine.
here is my report.
Install pthreads extension as a shared lib.
cd ~/
git clone git://github.com/krakjoe/pthreads.git
cd pthreads
phpize
./configure
make
make install
# and add extension=pthreads.so to php.ini
run a thread
chobie@ubuntu:~/src/pthreads$ php -r 'class T extends Thread{function run(){}};$t = new T();$t->start();'
php: symbol lookup error: /home/chobie/.phpenv/versions/5.4.6-zts/lib/php/extensions/no-debug-zts-20100525/pthreads.so: undefined symbol: zend_activate
can't find zend_activate
symbol.
okay, check zend_activate symbols
chobie@ubuntu:~/src/pthreads$ nm modules/pthreads.so | grep zend_activate
U zend_activate
U zend_activate_modules
chobie@ubuntu:~/src/pthreads$ readelf --dyn-syms /home/chobie/.phpenv/versions/5.4.6-zts/bin/php | grep zend_activate
2206: 00000000007c9920 35 FUNC GLOBAL DEFAULT 13 zend_activate_auto_global
there is no zend_activate
symbol on php's dynamic symbols table. so pthreads extension can't lookup the function I think.
build environment
================================================================================
BUILD ENVIRONMENT
================================================================================
OS:
Linux - Linux ubuntu 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64
Autoconf:
autoconf (GNU Autoconf) 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
Bundled Libtool:
ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.492 2008/01/30 06:40:56)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
System Libtool:
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit <[email protected]>, 1996
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiler:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu2)
Bison:
bison (GNU Bison) 2.5
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks
from pthreads.
I have a solution to this that presents an opportunity for some optimization, but haven't the time to implement it for a few days. It will be fixed in the next week or so ... hope you're getting on with it otherwise ...
from pthreads.
I'm afraid that after a closer look, this cannot be reasonable solved. Copying these functions into the pthreads source will be a maintenance nightmare ...
So I'm going to have to close this as a non-issue, pthreads will have to be statically compiled for now, it's not worth the instability, sorry.
from pthreads.
no problem, thank you!
from pthreads.
Just to give you an update, you can now build shared ... I still don't recommend it, but it's got to be an option for testing, and so it is ... in production you should compile statically, initialization of the threads environment is less than optimal when loading pthreads as a DSO.
from pthreads.
@krakjoe Thank you. this would be helpful that testing pthreads features.
Just to give you an update, you can now build shared ... I still don't recommend it, but it's got to be an option for testing, and so it is ... in production you should compile statically, initialization of the threads environment is less than optimal when loading pthreads as a DSO.
i think you should add this attention to README.md.
from pthreads.
Thanks Joe, glad you got this working. You're awesome!
from pthreads.
Related Issues (20)
- Volatile isn't thread safe HOT 7
- Halting development of pthreads for 7.4 HOT 1
- Lost resource.
- Pool Completed Threaded Tasks Count Progress.
- Can not enable extension pthreads on PHP 7.2.15 Windows 10 Enterprise (x64) HOT 3
- sudo pecl install pthreads /usr/local/bin/pecl: 28: exec: /usr/local/bin/php: not found
- PHPIZE? HOT 1
- How to get unique php-extension instance for each php thread? HOT 6
- PHP 7.1.23 compile failed HOT 3
- Migrating to Pararell and Differences between these two extensions. HOT 1
- zend_mm_heap corrupted without sockets
- php-zts with pthreads not allocating tasks to free workers HOT 3
- Serialization of 'Closure' is not allowed in Worker HOT 5
- PHP7.4 HOT 2
- [BUG] PHP7.2 broken after this commit HOT 6
- Cannot install via pecl HOT 2
- Memory "leak" when passing large payload tasks to pool HOT 2
- windos load pthread.dll failed HOT 1
- Make not working HOT 1
- memory leak when pthreads in pthreads HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pthreads.