首页 > 代码库 > 进程与生产者消费者模型

进程与生产者消费者模型

#!/usr/src/python
# -*- coding:utf-8 -*-

# from multiprocessing import Process
# import time
#
#
# def process_test(name):
# print(‘%s is testing‘%name)
# time.sleep(2)
# print(‘%s test end‘%name)
#
#
# if __name__ == ‘__main__‘:
# p1 = Process(target=process_test, args=(‘larry‘,))
# p2 = Process(target=process_test, args=(‘linzhengjun‘,))
# p3 = Process(target=process_test, args=(‘linzj‘,))
# p4 = Process(target=process_test, args=(‘lzj‘,))
#
# p1.start()
# p2.start()
# p3.start()
# p4.start()
# print(‘master thread‘)

进程与生产者消费者模型