Added speedup project code.

This commit is contained in:
2025-09-12 18:07:37 +02:00
parent 348a288fa3
commit 96391138a4
6 changed files with 232 additions and 0 deletions

View File

@ -0,0 +1,35 @@
from concurrent import interpreters
from libspeedup import my_stat_counter
def calc():
my_stat_counter(2)
my_stat_counter(2)
a = my_stat_counter(2)
print(a)
def main():
my_stat_counter(1)
my_stat_counter(1)
int1 = interpreters.create()
int2 = interpreters.create()
int3 = interpreters.create()
t1 = int1.call_in_thread(calc)
t2 = int2.call_in_thread(calc)
t3 = int3.call_in_thread(calc)
t1.join()
t2.join()
t3.join()
int1.close()
int2.close()
int3.close()
print(my_stat_counter(1))
if __name__ == "__main__":
main()