”’
Lock version Producer and consumer model
”’
import threading
import random
import time
gMoney < /span>= 1000 # Original amount
gLoad = threading.Lock()
gTime = 0 # production times
class Prod
”’
Lock version Producer and consumer model
”’
import threading
import random
import time
gMoney < /span>= 1000 # Original amount
gLoad = threading.Lock()
gTime = 0 # production times
class Prod