python使用queue,进程间却无法通信

pycharm下使用queue想进行两个进程间通信,失败了
from multiprocessing import Process, Queue

消息队列

q1 = Queue(3)

def request():
print("使用wx登录?")
q1.put("请求用户名密码") # 写消息队列

def handle():
data = q1.get(block=True, timeout=3) # 读消息队列
print("收到请求:", data)

if name == 'main':
p1 = Process(target=request)
p2 = Process(target=handle)
p1.start()
p2.start()
p1.join()
p2.join()

运行后在打印出 "使用wx登录?" 后就一直阻塞,3秒后报错Empty
后来尝试在p1中打印q1.get()是可以打印出的,在主进程中打印q1.get() 还是空的
这是为什么呢?希望能得到解答。

q1要作为创建子进程的参数传入,不能直接把它当作全局变量使用