-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.python
More file actions
32 lines (23 loc) · 510 Bytes
/
test.python
File metadata and controls
32 lines (23 loc) · 510 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Queue
import threading
class DoRun(threading.Thread):
def __init__(self,queue):
threading.Thread.__init__(self)
self.queue = queue
def run(self):
while not self.queue.empty():
key = self.queue.get()
def main():
threads = []
threads_count = 10
queue = Queue.Queue()
for i in range(1,255):
queue.put('10.97.213.'+str(i))
for i in range(threads_count):
threads.append(DoRun(queue))
for i in threads:
i.start()
for i in threads:
i.join()
if __name__ == '__main__':
main()