#!/usr/bin/env python
# -*- coding: utf-8 -*-
from subprocess import *
from threading import *
THREAD_COUNT=50
def worker():
p = Popen(["cat"], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
out = p.communicate("hoge")[0]
print "%s %s" % (current_thread().name, out)
threads = []
for i in range(THREAD_COUNT):
worker()