Kungani i-multi-threading ingenzi ikhodi yami yePython isheshe? Ngingakulungisa kanjani.
I-Python ivimbela ukufinyelela kumhumushi nge-Global Interpreter Lock, ebizwa ngokuthi i-GIL, ngezidingo zangaphakathi zokuphepha kwezintambo. Ngeshwa, lesi sinqumo sokuklama sivimbela ukuthi kube nesici esisodwa kuphela esihumusha ikhodi yePython ngasikhathi, ngisho nasemshinini onekhono lokusebenzisa izihloko eziningi ndawonye.  Uma ufuna ukusebenzisa ikhodi yePython kusethi yedatha, futhi idatha ingahlukaniswa ibe izingxenye ezizimele (inqubo eyaziwa ngokuthi ukwahlukanisa idatha), ungahle uthande ukubheka umtapo wezincwadi wokucubungula okuningi ePython.  Njengesibonelo, cabanga ngomsebenzi u-foo othatha i-argument eyodwa, u-arg1, futhi uthi ufuna ukusebenzisa umsebenzi u-foo enanini lamagugu, uthi, u-val1, u-val2, no-val3.  def foo ((arg1)): # yenza okuthile  if __name__ == '__main__': isiZulu isiZulu) isiZulu)  Ukuze u-foo asebenze ezinqubweni eziningi kanyekanye, ungasebenzisa i-Multiprocessing Pool ukugijima izinqubo eziningi zomsebenzi kanyekanye:  kusuka ku-multiprocessing import Pool  def foo ((arg1)): # yenza okuthile  if __name__ == '__main__': p = Iqembu p.map ((foo, [val1, val2, val3])  Umtapo wezincwadi we-multiprocessing uphinde unikeze amanye ama-API ahlukahlukene wokuhlela okuhambisanayo. Ungathanda ukwazi okwengeziwe?