# Chapter 5/shared_ipc.py
import time
from threading import Thread, current_thread
SIZE = 5
shared_memory = [-1] * SIZE ----- ➊
class Producer(Thread):
def run(self) -> None:
self.name = "Producer"
global shared_memory
for i in range(SIZE):
print(f"{current_thread().name}: 데이터 쓰기 {int(i)}")
shared_memory[i - 1] = I ----- ➋
class Consumer(Thread):
def run(self) -> None:
self.name = "Consumer"
global shared_memory
for i in range(SIZE):