//主流程
Rem 添加缓存名为a的键名,值为cc,过期时间20秒
MeCache.put("a","cc",20)
Do While True
TracePrint("主流程开始")
delay(1000)
CollectGarbage()
Loop
//子流程1
Rem 无限获取键名a的值cc,
Do While True
TracePrint("子线程1开始")
delay(2000)
rCache = MeCache.get("a","")
TracePrint(rCache)
Rem 键名a的值过期则给b赋值并唤醒子流程2
If rCache = ""
TracePrint("清空缓存a的值")
MeCache.put("b","子线程2开始",20)
CollectGarbage()
End If
Loop
//子流程2
Do While True
rCache = MeCache.get("b","")
If rCache <> ""
TracePrint(rCache)
delay(2000)
End If
CollectGarbage()
Loop