前言

我准备用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. HDU 1097 快速幂

    #include<iostream> using namespace std; long long quick(long long a,long long b,int c) { ; a=a ...

  2. Android如何安装系统应用,及自己增加安装系统应用的接口

    根据SIM卡安装系统应用 功能: 1:如何安装系统应用,apk放在system/app系统分区下面. 2:根据SIM卡的归属国家选择性的安装应用. 一:本人使用方法: 在开机的服务里面添加接口(Pac ...

  3. C# 利用*.SQL文件自动建库建表等的类

    /// <summary> /// 自动建库建表 /// </summary> public class OperationSqlFile { SqlConnection sq ...

  4. swagger2简单使用

    1.引入jar <!--引入swagger--> <dependency> <groupId>io.springfox</groupId> <ar ...

  5. 添加tomcat为启动服务/删除tomcat服务

    在很多生产把环境下,tomcat的启动要随着windows的启动一起启动,这个时候就需要将tomcat添加成服务.步骤如下: 1:环境配置 配置jdk环境变量: JAVA_HOME:jdk路径 配置p ...

  6. xsens melodic ros driver

    sudo apt-get update sudo apt-get install ros-melodic-xsens-driver 设置数据输出: // 输出四元数,加速度.角速度.地磁 python ...

  7. Hybrid平台

    需求说明 离线包管理平台主要负责对需要接入Hybrid平台的应用进行管理,通过这个平台可以实现对应用的静态资源进行构建.发布.生成离线包,版本控制等,核心场景如下: 将需要做预加载的应用在平台上注册, ...

  8. JavaScript中this的一些坑

    我们经常在回调函数里面会遇到一些坑: var obj = { name: 'qiutc', foo: function() { console.log(this); }, foo2: function ...

  9. java网络通信:netty

    Netty提供异步的.事件驱动的网络应用程序框架和工具,用以快速开发高性能.高可靠性的网络服务器和客户端程序. 也就是说,Netty 是一个基于NIO的客户,服务器端编程框架,使用Netty 可以确保 ...

  10. Python学习之==>接口开发

    一.开发接口的作用 1.在别的接口没有开发完成的时候可以模拟一些接口以便测试已经开发完成的接口,例如假的支付接口,模拟支付成功.支付失败. 2.了解接口是如何实现的:数据交互.数据返回 3.开发给别人 ...