前言

我准备用stackless模拟游戏玩家登陆/注册等行为,测试游戏服务器的性能。

但是在安装stackless的过程中遇到了很多问题,特此记录下来,也分享给需要的朋友。

关于stackless

Stackless Python is an experimental implementation of the Python language.

Stackless was designed from the start to overcome the limitations of cPython's Global Interpreter Lock by using tasklets, which implement functions as microthreads.

environment

(1) Ubuntu 12.04.5 LTS (GNU/Linux 3.5.0-23-generic x86_64)

(2) Python 2.7.3    [GCC 4.6.3] on linux2

Install

First install the required libraries and get stackless itself:

 sudo apt-get install libreadline-dev

 cd /tmp

 wget http://www.stackless.com/binaries/stackless-273-export.tar.bz2

 bunzip2 stackless-273-export.tar.bz2

 tar xf stackless-273-export.tar

install stackless:

 cd /tmp/stackless-273-export/

 ./configure --prefix=/opt/stackless --enable-unicode=ucs4

 make

sudo make install

如果./configure 报错,首先检查是否已安装gcc,安装命令sudo apt-get install gcc

Now it's time to link your standard (CPython) packages so that they can be used with stackless:

 sudo ln -s /usr/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/dist-packages

 sudo ln -s /usr/local/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/dist-packages

 sudo ln -s  /opt/stackless/bin/python /usr/bin/stackless

edit the paths in the site.py file.

At about line 302, edit the file to look like this. It's the second site-packages.append bit we're adding here:

 sudo vi /opt/stackless/lib/python2.7/site.py

 line 302:
elif os.sep == '/':
sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
"site-packages"))
sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
"dist-packages"))
sitepackages.append(os.path.join(prefix, "lib", "site-python"))

That should be it! Let's test it:

check symbolic link

Install success.

about stackless python

Introduction to Concurrent Programming with Stackless Python

english: (1) http://www.stackless.com/

(2) http://www.grant-olson.net/files/why_stackless.html

(3) https://bitbucket.org/stackless-dev

中文:http://gashero.yeax.com/?p=30

install stackless python on ubuntu的更多相关文章

  1. Install LAMP Stack On Ubuntu 16.04

    原文:http://www.unixmen.com/how-to-install-lamp-stack-on-ubuntu-16-04/ LAMP is a combination of operat ...

  2. python mongodb ubuntu

    mongodb install: sudo apt-get install mongodb Install pip 1. $ sudo apt-get install python-pip pytho ...

  3. Install Google Pinyin on Ubuntu 14.04

    Install Google Pinyin on Ubuntu 14.04 I've been spending more and more time on Ubuntu and I'm not us ...

  4. HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits

    安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install ...

  5. Install a Redmine on Ubuntu system

    # How to install a Redmine on Ubuntu system Ref to: https://www.linode.com/docs/applications/project ...

  6. How do you install Google Chrome on Ubuntu?

    https://askubuntu.com/questions/510056/how-to-install-google-chrome sudo apt-get install chromium-br ...

  7. Install eclipse ns3 in ubuntu 14.04

    1. NS3 install 参考NS3 tutorial即可. 2.eclipse 2.1下载 下载地址:http://www.eclipse.org/downloads/              ...

  8. 【转载】Stackless Python并发式编程介绍[已校对版]

    Stackless Python并发式编程介绍[已校对版] 作者:    Grant Olson 电子邮件:    olsongt@verizon.net 日期:    2006-07-07 译者:  ...

  9. install dns server on ubuntu

    参考 CSDN/Ubuntu环境下安装和配置DNS服务器 在 Ubuntu 上安裝 DNS server Install BIND 9 on Ubuntu and Configure It for U ...

随机推荐

  1. formData和input的file结合使用

    <form method="POST" id="uploadForm" enctype="multipart/form-data"&g ...

  2. Mysql中 BLOB字段转String的方法

    转:https://www.cnblogs.com/renjie0520/p/5242350.html 1.通过sql直接转换 select CONVERT (*** USING utf8) AS u ...

  3. crontab定时调度shell脚本

    本人最近要用crontab做一个定时调度任务,调一个启动脚本去执行jar包,并给main方法传一个日期参数. Linux系统:CentOS7 输入: crontab -e 在里面编写: SHELL=/ ...

  4. Zookeeper集群及配置

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  5. IoC有什么好处

    IoC(Inversion of Control):控制反转. DI(Dependency Injection):依赖注入. 控制反转是目的,依赖注入是实现控制反转的手段. 控制反转是一种面向对象的思 ...

  6. 如果将get请求转换成post请求

    td><a href="emp/${emp.id}">Edit</a></td> <form action="" ...

  7. 让hibernate支持mysql的text或者longtext

    public class CustomDialect extends MySQL5Dialect { public CustomDialect() { super(); registerHiberna ...

  8. 安装ubuntu双系统

    今天在win7下安装ubuntu14.1双系统,别折磨了一个下午.主要是开机系统引导问题. 引导程序是位于硬盘最前面的一段程序,由于扇区大部分是引导程序,故也成引导扇区.此外包含有硬盘的分区信息,共6 ...

  9. linux(centOS7)的基本操作(一) 概述

    linux服务器的连接 1.连接 window环境下需要安装XShell.XFtp等软件,暂时不表: macOS环境下直接用ssh命令登录即可,用以下任意一种 ssh [-p port] userna ...

  10. 五:flask-url_for使用详解

    from flask import url_for url_for(视图函数名):根据视图函数名指定url,只要视图函数不变,url随便变都不会影响 url_for源码: 示例视图,执行流程 带参数: ...