Problem with threading: can't start new thread

S

sufrank

I am doing stress test with python using threading, I have encountered
the can't start new thread problem when running the script.
The system is Linux, python version 2.4

Traceback (most recent call last):
File "./imap_test.py", line 38, in ?
current.start()
File "/usr/lib/python2.4/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread


Part of my testing scripts(python) is as followed:

#!/usr/bin/python

import const;
import imap_pattern;

import os
import re
import time
import sys
from threading import Thread
import logging

Userno_Max = 1000
class client(Thread):
def __init__ (self,ID,type,username):
Thread.__init__(self)
self.username = username
self.type = type
self.ID = ID
def run(self):
print self.ID

myTest = imap_pattern.imap_pattern(self.ID)
myTest.run_pattern(self.type,self.username)

if __name__ == '__main__':
print time.ctime()
Users = int(sys.argv[1])
Period = float(sys.argv[2])


id = 1
for host in range(0,1000):
username = "%s%d@%s" %(const.Username_Prefix, id % Userno_Max,
const.Domain)
current = client(id,1,username)
current.start()
id += 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top