Compiling Python-2.7.6 with lpth as Native threading library

 

wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz

tar -xzf Python-2.7.6.tgz

patch -p0 < python_pth_patch

cd  Python-2.7.6

./configure --with-pth  --prefix=/your/custom/installation/path

find . -name Makefile -exec sed -i "s/-lpthread/-lpth/" {} \;

sed -i "s/-pthread//" Makefile

sed -i 's/$(srcdir)\/Python\/thread_pthread.h//' Makefile

make

make test

make install

export PATH=/your/custom/installation/path/bin:$PATH

export LD_LIBRARY_PATH=/your/custom/installation/path/lib:$LD_LIBRARY_PATH

 

References:

[1] http://blogger.popcnt.org/2007/10/gnu-pth-instead-of-pthread-hardcore.html

[2] https://www.iram.fr/IRAMFR/GILDAS/doc/html/gildas-python-html/node36.html

[3] https://github.com/majek/dump/blob/master/ai.pjwstk.edu.pl/pyconfig.h.in-pth-patch.diff

 

 

How to install python modules for Customized Python?

 

sudo apt-get install python-setuptools

export PYTHONPATH=/your/custom/installation/path/lib/python2.7/site-packages

easy_install --prefix=/your/custom/installation/path package_name

 

Reference:

[1] http://stackoverflow.com/questions/7465445/how-to-install-python-modules-without-root-access

 

 

Tornado Web server installation

easy_install --prefix=/your/custom/installation/path tornado

easy_install --prefix=/your/custom/installation/path singledispatch

easy_install --prefix=/your/custom/installation/path backports_abc

easy_install --prefix=/your/custom/installation/path certifi

 

Or

 

I forgot about whether we need to export PYTHON_PATH/ LD_LIBRARY_PATH.

 

tar -xvzf tornado-4.3.tar.gz

cd tornado-4.3

python setup.py build

python setup.py install

 

References:

[1] http://www.tornadoweb.org/en/stable/index.html

[2] http://www.acmesystems.it/tornado_web_server_python

[3] https://backchannel.org/blog/tornado

[4] https://developers.facebook.com/blog/post/301

[5] https://en.wikipedia.org/wiki/Tornado_(web_server)

[6] https://www.quora.com/How-difficult-is-it-to-make-Python-web-applications-scale

 

 

About Multithreading with Tornado:

[1] http://stackoverflow.com/questions/15375336/how-to-best-perform-multiprocessing-within-requests-with-the-python-tornado-serv

[2] https://github.com/tornadoweb/tornado/wiki/Threading-and-concurrency

 

 

GNU Pth mail archives

[1] http://www.mail-archive.com/pth-users@gnu.org/mail2.html

 

 

Compile program with specific library path

[1] http://askubuntu.com/questions/386315/how-to-add-libraries-path-to-the-configure-command

 

 

Vireo, a green thread library

[1] https://github.com/geofft/vireo

 

 

GNU Pth compilation

 

tar -xvzf pth-2.0.7.tar.gz

cd pth-2.0.7

./configure --prefix=/your/custom/installation/path --enable-pthread

make

make test

make install

 

 

Running ApacheBench

 

ab -n <#requests> -c <#concurrency> http://ip:port/

[1] http://www.cyberciti.biz/tips/howto-performance-benchmarks-a-web-server.html

 

 

Entry Points:

/arch/x86/syscalls/syscall_64.tbl