ACIL FM
Dark
Refresh
Current DIR:
/opt/alt/python313/lib64/python3.13/test/test_free_threading
/
opt
alt
python313
lib64
python3.13
test
test_free_threading
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
test_code.py
912 B
chmod
View
DL
Edit
Rename
Delete
test_dict.py
5.44 MB
chmod
View
DL
Edit
Rename
Delete
test_func_annotations.py
2.55 MB
chmod
View
DL
Edit
Rename
Delete
test_gc.py
1.45 MB
chmod
View
DL
Edit
Rename
Delete
test_list.py
1.77 MB
chmod
View
DL
Edit
Rename
Delete
test_monitoring.py
6.42 MB
chmod
View
DL
Edit
Rename
Delete
test_set.py
1.08 MB
chmod
View
DL
Edit
Rename
Delete
test_slots.py
1001 B
chmod
View
DL
Edit
Rename
Delete
test_str.py
1.97 MB
chmod
View
DL
Edit
Rename
Delete
test_tokenize.py
2.16 MB
chmod
View
DL
Edit
Rename
Delete
test_type.py
3.57 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
225 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/alt/python313/lib64/python3.13/test/test_free_threading/test_gc.py
import unittest import threading from threading import Thread from unittest import TestCase import gc from test.support import threading_helper class MyObj: pass @threading_helper.requires_working_threading() class TestGC(TestCase): def test_get_objects(self): event = threading.Event() def gc_thread(): for i in range(100): o = gc.get_objects() event.set() def mutator_thread(): while not event.is_set(): o1 = MyObj() o2 = MyObj() o3 = MyObj() o4 = MyObj() gcs = [Thread(target=gc_thread)] mutators = [Thread(target=mutator_thread) for _ in range(4)] with threading_helper.start_threads(gcs + mutators): pass def test_get_referrers(self): event = threading.Event() obj = MyObj() def gc_thread(): for i in range(100): o = gc.get_referrers(obj) event.set() def mutator_thread(): while not event.is_set(): d1 = { "key": obj } d2 = { "key": obj } d3 = { "key": obj } d4 = { "key": obj } gcs = [Thread(target=gc_thread) for _ in range(2)] mutators = [Thread(target=mutator_thread) for _ in range(4)] with threading_helper.start_threads(gcs + mutators): pass if __name__ == "__main__": unittest.main()
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply