Multi-process problem of Python

from multiprocessing.managers import BaseManager
import queue

db = {"name": "123456"}
print(dir(db))

class RegisterManager(BaseManager):
    pass

def getUsers():
    return db

RegisterManager.register("getUsers", getUsers)

manager = RegisterManager(address = ("127.0.0.1", 5000), authkey=b"666")
if __name__ == "__main__":
    manager.start()
    userTable = manager.getUsers()
    print(dir(userTable))
    userTable["name"] = ""
    manager.shutdown()

this is my code. Line 22 will report an error

5

19manager__setitem__
20

Apr.05,2021

use SyncManager , such as

-sharp -*- coding: utf-8 -*-
from multiprocessing.managers import SyncManager


class RegisterManager(SyncManager):
    pass


if __name__ == "__main__":
    manager = RegisterManager(address=("127.0.0.1", 5000), authkey=b"666")
    manager.start()
    userTable = manager.dict()
    userTable["key"] = "hi"
    manager.shutdown()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb6789-483ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb6789-483ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?