From e5da4b964ac659711e9c9a52074b0d82471e7110 Mon Sep 17 00:00:00 2001 From: nurikhsanisf Date: Tue, 29 Mar 2022 22:35:16 +0700 Subject: [PATCH 1/4] Tugas Sistem Tersebar Chapter1 bagian Nur Ikhsani --- Chapter01/studiKasus/filepasiencovid.py | 22 ++++++++++++++++++++++ Chapter01/studiKasus/listjenistumbuhan.py | 14 ++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Chapter01/studiKasus/filepasiencovid.py create mode 100644 Chapter01/studiKasus/listjenistumbuhan.py diff --git a/Chapter01/studiKasus/filepasiencovid.py b/Chapter01/studiKasus/filepasiencovid.py new file mode 100644 index 0000000..bc328b5 --- /dev/null +++ b/Chapter01/studiKasus/filepasiencovid.py @@ -0,0 +1,22 @@ +#melakukan percobaan mengimplementasi Input pada file +f = open ('inputPasienCovid.txt', 'w') #membaca file di luar +nik = input ("Masukan NIK :") +nama = input("Masukan Nama : ") +alamat = input("Masukan Alamat : ") +umur = input("Masukan Usia : ") +jeniskelamin = input("Masukan Jenis Kelamin: ") +nohp = input("Masukan Nohp : ") +gejala = input("Masukan Gejala : ") +f.write ("NIK : " + nik + "\n") #menulis ke dalam file +f.write ("Nama : " + nama + "\n") +f.write ("Alamat : " + alamat + "\n") +f.write ("Umur : " + umur + "\n") +f.write ("Jenis Kelamin : " + jeniskelamin + "\n") +f.write ("No Hp : " + nohp + "\n") +f.write ("Gejala : " + gejala + "\n") +f.close()#keluarkan file nya +f = open ('inputPasienCovid.txt') #buka file +content = f.read() +print (content) #render content yang ada di dalam file nya + +f.close() diff --git a/Chapter01/studiKasus/listjenistumbuhan.py b/Chapter01/studiKasus/listjenistumbuhan.py new file mode 100644 index 0000000..9785e3a --- /dev/null +++ b/Chapter01/studiKasus/listjenistumbuhan.py @@ -0,0 +1,14 @@ +bunga =["Angrek", "Mawar", "Melati", "Kamboja", "Teratai", "Lily", "Tulip", "Kertas", "Asoka", "Bougenville", "Kemuning "] +print(bunga) +print(bunga[0]) +print(bunga[6:9]) +bunga[0] = "Anggrek Ungu" +bunga[1] = "Mawar Putih" +print(bunga) +KeteranganMawarPutih ={"Nama":"Mawar Putih"} +print(KeteranganMawarPutih) +pohon = ("Mangga", "Nangka", "Rambutan", "Jambu Batu", "Jambu Air", "Pisang", "Duren") +print(pohon) +mengukurPanjangData = len +print(mengukurPanjangData(bunga)) +print(mengukurPanjangData(pohon)) \ No newline at end of file From b4e869748687e55f48795a546b14359cc234b9ae Mon Sep 17 00:00:00 2001 From: ayulestarinasution Date: Tue, 29 Mar 2022 23:00:12 +0700 Subject: [PATCH 2/4] Study Kasus --- Chapter01/studiKasus/dir.py | 16 ++++++++++++++++ Chapter01/studiKasus/flow.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Chapter01/studiKasus/dir.py create mode 100644 Chapter01/studiKasus/flow.py diff --git a/Chapter01/studiKasus/dir.py b/Chapter01/studiKasus/dir.py new file mode 100644 index 0000000..c154c45 --- /dev/null +++ b/Chapter01/studiKasus/dir.py @@ -0,0 +1,16 @@ +masuk=int(input("Masukkan Jam Masuk = ")) +keluar=int(input("Masukkan Jam Keluar =")) +lama=keluar-masuk +payment=12000 +print("Lama Mengajar = ", lama, "jam") +if lama <=1: + satu_jam_pertama=payment + print("Biaya Mengajar= Rp", satu_jam_pertama) +elif lama <10: + biaya_selanjutnya = (lama+1)*3000+payment + print("Biaya Mengajar = Rp", biaya_selanjutnya) +elif lama >= 10: + print("Biaya Mengajar = Rp", 1000000) +else: + print("nul") + \ No newline at end of file diff --git a/Chapter01/studiKasus/flow.py b/Chapter01/studiKasus/flow.py new file mode 100644 index 0000000..2c5960a --- /dev/null +++ b/Chapter01/studiKasus/flow.py @@ -0,0 +1,33 @@ + +# IF + +# In this program, we check if the number is positive or negative or zero and +# display an appropriate message + +# Flow Control + +x=7 +if x >10: + print("x is the value is big.") +elif x > 0: + print("x the value is small.") +else: + print("x is not positive.") + +# Array + +# Variabel array +genap = [14,24,56,80] +ganjil = [13,55,73,23] + +nap = 0 +jil = 0 + +# Buat looping for menggunakanvariable dari array yang udah dibuat +for val in genap: + nap = nap+val + for val in ganjil: + jil = jil+val + +print("Ini adalah bilangan Genap", nap ) +print("Ini adalah bilangan Ganjil", jil ) \ No newline at end of file From dc9d648031dc97ef4d97d84db396beb34cff5e1e Mon Sep 17 00:00:00 2001 From: ayulestarinasution Date: Wed, 20 Apr 2022 12:27:50 +0700 Subject: [PATCH 3/4] Quis_1194007_Ayu_Lestari_Nasution --- .vscode/settings.json | 5 ++ Chapter01/dir.py | 48 ++++-------- Chapter01/flow.py | 49 +++++------- .../MyThreadClass_lock_2sk.py | 66 ++++++++++++++++ .../MyThreadClass_locksk.py | 59 ++++++++++++++ .../MyThreadClassk.py | 56 ++++++++++++++ .../Rlocksk.py | 60 +++++++++++++++ .../Thread_definitionsk.py | 24 ++++++ .../Threading_with_queuesk.py | 60 +++++++++++++++ .../barier.py | 23 ++++++ .../conditionsk.py | 77 +++++++++++++++++++ .../eventsk.py | 54 +++++++++++++ .../studykasusThread_determine.py | 27 +++++++ .../studykasusThread_name_and_processes.py | 43 +++++++++++ .../studykasussemaphore.py | 41 ++++++++++ Chapter02/Event.py | 12 +-- Chapter02/MyThreadClass.py | 32 ++------ Chapter02/MyThreadClass_lock_2.py | 44 ++++------- Chapter02/Rlock.py | 24 +++--- Chapter02/Semaphore.py | 14 ++-- Chapter02/Thread_definition.py | 6 +- Chapter02/Thread_name_and_processes.py | 14 +++- 22 files changed, 690 insertions(+), 148 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py create mode 100644 Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..67213c9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "python.testing.unittestArgs": ["-v", "-s", "./Chapter01", "-p", "*test.py"], + "python.testing.pytestEnabled": false, + "python.testing.unittestEnabled": true +} diff --git a/Chapter01/dir.py b/Chapter01/dir.py index 65da81d..c154c45 100644 --- a/Chapter01/dir.py +++ b/Chapter01/dir.py @@ -1,34 +1,16 @@ -# Dalam program ini, -# kami memeriksa apakah angkanya positif atau negatif atau nol dan -# tampilkan pesan yang sesuai - -num = 1 - -# Try these two variations as well: -# num = 0 -# num = -4.5 - -if num > 0: - print("Positive number") -elif num == 0: - print("Zero") +masuk=int(input("Masukkan Jam Masuk = ")) +keluar=int(input("Masukkan Jam Keluar =")) +lama=keluar-masuk +payment=12000 +print("Lama Mengajar = ", lama, "jam") +if lama <=1: + satu_jam_pertama=payment + print("Biaya Mengajar= Rp", satu_jam_pertama) +elif lama <10: + biaya_selanjutnya = (lama+1)*3000+payment + print("Biaya Mengajar = Rp", biaya_selanjutnya) +elif lama >= 10: + print("Biaya Mengajar = Rp", 1000000) else: - print("Negative number") - - - -# Program to find the sum of all numbers stored in a list - -# List of numbers -numbers = [6, 6, 3, 8, -3, 2, 5, 44, 12] - -# variable to store the sum -sum = 0 - -# iterate over the list -for val in numbers: - sum = sum+val - -# Output: The sum is 48 -print("The sum is", sum) - + print("nul") + \ No newline at end of file diff --git a/Chapter01/flow.py b/Chapter01/flow.py index 8b2c0cc..d5356a3 100644 --- a/Chapter01/flow.py +++ b/Chapter01/flow.py @@ -4,37 +4,30 @@ # In this program, we check if the number is positive or negative or zero and # display an appropriate message -num = 1 -if num > 0: - print("Positive number") -elif num == 0: - print("Zero") -else: - print("Negative number") - +# Flow Control -# FOR -# Program to find the sum of all numbers stored in a list -numbers = [6, 6, 3, 8, -3, 2, 5, 44, 12] -sum = 0 -for val in numbers: - sum = sum+val - -# Output: The sum is 48 -print("The sum is", sum) +x=7 +if x>10: + print("x is big.") +elif x > 0: + print("x is small.") +else: + print("x is not positive.") +# Array -#WHILE -# Program to add natural numbers upto sum = 1+2+3+...+n +# Variabel array +genap = [14,24,56,80] +ganjil = [13,55,73,23] -n = 10 -# initialize sum and counter -sum = 0 -i = 1 -while i <= n: - sum = sum + i - i = i+1 # update counter +nap = 0 +jil = 0 -# print the sum -print("The sum is", sum) +# Buat looping for menggunakanvariable dari array yang udah dibuat +for val in genap: + nap = nap+val + for val in ganjil: + jil = jil+val +print("Ini adalah bilangan Genap", nap ) +print("Ini adalah bilangan Ganjil", jil ) \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py new file mode 100644 index 0000000..16fc72f --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 12:17:34 2022 + +@author: Acer +""" + +import threading +import time +import os +from threading import Thread +from random import randint + +# Lock Definition +threadLock = threading.Lock() + +class MyPasien (Thread): + def _init_(self, name, duration): + Thread._init_(self) + self.name = name + self.duration = duration + def run(self): + #Acquire the Lock + threadLock.acquire() + print ("---> " + self.name + \ + " pasien, ID pasiens "\ + + str(os.getpid()) + "\n") + threadLock.release() + time.sleep(self.duration) + print ("---> " + self.name + " selesai\n") + #Release the Lock + + +def main(): + start_time = time.time() + + # Thread Creation + thread1 = MyPasien("daftar pasien {}", randint(1,10)) + thread2 = MyPasien("daftar pasien {}", randint(1,10)) + + + # Thread Running + thread1.start() + thread2.start() + + + # Thread joining + thread1.join() + thread2.join() + + + + # End + print("End") + + #Execution Time + print("--- %s detik ---" % (time.time() - start_time)) + + +if __name__ == "__main__": + main() + + + + +#class_lock2 \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py new file mode 100644 index 0000000..ec6afe6 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 11:20:40 2022 + +@author: Acer +""" + +import threading +import time +import os +from threading import Thread +from random import randint + +# Lock Definition +threadLock = threading.Lock() + +class MyPasien(Thread): + def _init_(self, name, duration): + Thread._init_(self) + self.name = name + self.duration = duration + def run(self): + #Acquire the Lock + threadLock.acquire() + print ("---> " + self.name + \ + " no daftar adalah "\ + + str(os.getpid()) + "\n") + time.sleep(self.duration) + print ("---> " + self.name + " selesai diberikan no daftar\n") + #Release the Lock + threadLock.release() + + +def main(): + start_time = time.time() + # Thread Creation + thread1 = MyPasien("no pasien ", randint(1,10)) + thread2 = MyPasien("pasien no ", randint(1,10)) + + + + # Thread Running + thread1.start() + thread2.start() + + + + # Thread joining + thread1.join() + thread2.join() + + + #Execution Time + print("waktu yang dibutuhkan untuk mengerjakan soal %s seconds soal" % (time.time() - start_time)) + + + +if __name__ == "__main__": + main() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py new file mode 100644 index 0000000..5858bd1 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 12:14:55 2022 + +@author: Acer +""" + +import time +import os +from random import randint +from threading import Thread + +class MyPasien (Thread): + def __init__(self, name, duration): + Thread.__init__(self) + self.name = name + self.duration = duration + def run(self): + print ("---> " + self.name + \ + " pasien diberikan no daftar "\ + + str(os.getpid()) + "\n") + time.sleep(self.duration) + print ("---> " + self.name + " over\n") + + +def main(): + start_time = time.time() + + # Thread Creation + thread1 = MyPasien("no daftar pasien ", randint(1,10)) + thread2 = MyPasien("no daftar pasien", randint(1,10)) + + + # Thread Running + thread1.start() + thread2.start() + + + # Thread joining + thread1.join() + thread2.join() + + + # End + print("End") + + #Execution Time + print("--- %s seconds ---" % (time.time() - start_time)) + + +if __name__ == "__main__": + main() + + + + diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py new file mode 100644 index 0000000..ffcda88 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py @@ -0,0 +1,60 @@ +import threading +import time +import random + + +class Periksa: + def __init__(self): + self.lock = threading.RLock() + self.total_items = 0 + + def execute(self, value): + with self.lock: + self.total_items += value + + def add(self): + with self.lock: + self.execute(1) + + def remove(self): + with self.lock: + self.execute(-1) + +def adder(periksa, items): + print("Banyaknya orang periksa hari ini {} jumlah to ADD \n".format(items)) + while items: + periksa.add() + time.sleep(1) + items -= 1 + print("jumlah pendaftar saat ini -->{} org \n".format(items)) + + + +def remover(periksa, items): + print("banyaknya org yang selesai di periksa{} no periksa to REMOVE \n".format(items)) + while items: + periksa.remove() + time.sleep(1) + items -= 1 + print("pasien sudah selesai melakukan pemeriksaan -->{} jml \n".format(items)) + + +def main(): + items = 10 + periksa = Periksa() + + t1 = threading.Thread(target=adder, \ + args=(periksa, random.randint(10,20))) + t2 = threading.Thread(target=remover, \ + args=(periksa, random.randint(1,10))) + + t1.start() + t2.start() + + + t1.join() + t2.join() + + +if __name__ == "__main__": + main() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py new file mode 100644 index 0000000..ebbc67d --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 10:43:10 2022 + +@author: Acer +""" + +import threading + + +def pasien(thread_number): + return print('pasien called by dokter {}'.format(thread_number)) + + +def main(): + threads = [] + for i in range(10): + t = threading.Thread(target=pasien, args=(i,)) + threads.append(t) + t.start() + t.join() + +if __name__ == "__main__": + main() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py new file mode 100644 index 0000000..1c58682 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 10:58:46 2022 + +@author: Acer +""" + +""""Thread synchronisation with queue""" + +from threading import Thread +from queue import Queue +import time +import random + + +class Daftar(Thread): + + def __init__(self, queue): + Thread.__init__(self) + self.queue = queue + + def run(self): + for i in range(3): + item = random.randint(0, 10) + self.queue.put(item) + print('Daftar Notify : no daftar di proses olehy %s\n'\ + % (item, self.name)) + time.sleep(1) + + +class Pemeriksaan(Thread): + + def __init__(self, queue): + Thread.__init__(self) + self.queue = queue + + def run(self): + while True: + item = self.queue.get() + print('Pemeriksaan notify : no daftar %d segera menuju ruang periksa '\ + % (item, self.name)) + self.queue.task_done() + +if __name__ == '__main__': + queue = Queue( + + t1 = Daftar(queue) + t2 = Pemeriksaan(queue) + t3 = Pemeriksaan(queue) + t4 = Pemeriksaan(queue) + + t1.start() + t2.start() + t3.start() + t4.start() + + t1.join() + t2.join() + t3.join() + t4.join() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py new file mode 100644 index 0000000..004d0d6 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py @@ -0,0 +1,23 @@ +from random import randrange +from threading import Barrier, Thread +from time import ctime, sleep +num = 4 +# 4 threads will need to pass this barrier to get released. +b = Barrier(num) +names = ['India', 'Japan', 'USA', 'China'] +def player(): + name = names.pop() + sleep(randrange(2, 5)) + print('%s reached the barrier at: %s \n' % (name, ctime())) + b.wait() +threads = [] +print("Race starts now…") +for i in range(num): + threads.append(Thread(target=player)) + threads[-1].start() +""" +Below loop enables waiting for the threads to complete before moving on with the main script. +""" +for thread in threads: + thread.join() +print("All Reached Barrier Point!") \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py new file mode 100644 index 0000000..8890d6e --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 09:45:59 2022 + +@author: Acer +""" + +import logging +import threading +import time + +LOG_FORMAT = '%(asctime)s %(threadName)-17s %(levelname)-8s %(message)s' +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) + +items = [] +condition = threading.Condition() + + +class Pasien(threading.Thread): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def daftar(self): + + with condition: + + if len(items) == 5: + logging.info('no daftar') + condition.wait() + + items.pop() + logging.info('no daftar {}'.format(len(items))) + + condition.notify() + + def run(self): + for i in range(7): + time.sleep(2) + self.daftar() + + +class Dokter(threading.Thread): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def periksa(self): + + with condition: + + if len(items) == 13: + logging.info('periksa {}. Stopped'.format(len(items))) + condition.wait() + + items.append(1) + logging.info('waktu periksa {}'.format(len(items))) + + condition.notify() + + def run(self): + for i in range(20): + time.sleep(0.5) + self.periksa() + + +def main(): + daftar = Pasien(name='Pasien') + periksa = Dokter(name='Dokter') + + daftar.start() + periksa.start() + + daftar.join() + periksa.join() + + +if __name__ == "__main__": + main() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py new file mode 100644 index 0000000..cabc896 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +""" +Created on Wed Apr 20 10:46:32 2022 + +@author: Acer +""" + +import logging +import threading +import time +import random + +LOG_FORMAT = '%(asctime)s %(threadName)-17s %(levelname)-8s %(message)s' +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) + +items = [] +event = threading.Event() + + +class Pasien(threading.Thread): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def run(self): + while True: + time.sleep(2) + event.wait() + item = items.pop() + logging.info('Pasien notify: {} pasien menuju ruang dokter {}'\ + .format(item, self.name)) + +class Dokter(threading.Thread): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def run(self): + for i in range(5): + time.sleep(2) + item = random.randint(0, 100) + items.append(item) + logging.info('Dokter notify: dolter memeriksa pasien {}'\ + .format(item, self.name)) + event.set() + event.clear() + +if __name__ == "__main__": + t1 = Pasien() + t2 = Dokter() + + t1.start() + t2.start() + + t1.join() + t2.join() diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py new file mode 100644 index 0000000..dc67e71 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py @@ -0,0 +1,27 @@ +import threading +import time + +def senam_pagi(): + print (threading.currentThread().getName()+str('--> yoga \n')) + time.sleep(3) + +def senam_sore(): + print (threading.currentThread().getName()+str('--> lari sore \n')) + time.sleep(2) + + + + + + +if __name__ == "__main__": + + + t1 = threading.Thread(name='senam_pagi', target=senam_pagi) + t2 = threading.Thread(name='senam_sore', target=senam_sore) + + t1.start() + t2.start() + + t1.join() + t2.join() \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py new file mode 100644 index 0000000..e21b7f8 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py @@ -0,0 +1,43 @@ +from threading import Thread +import time +import os + +class MakananClass (Thread): + def __init__(self, name): + Thread.__init__(self) + self.name = name + + def run(self): + print("Makanan Khas Sumut {}".format(self.name)) #, " is {} \n".format(os.getpid())) + +def main(): + from random import randint + # Thread Creation + thread1 = MakananClass("Mie Gomak ") + thread2 = MakananClass("Sambal Tuktuk") + thread3 = MakananClass("Bika Ambon") + thread4 = MakananClass("Sumur Jengkol ") + + # Thread Running + thread1.start() + thread2.start() + thread3.start() + thread4.start() + + + # Thread joining + thread1.join() + thread2.join() + thread3.join() + thread4.join() + + # End + print("End") + + +if __name__ == "__main__": + main() + + + + diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py new file mode 100644 index 0000000..ca6d660 --- /dev/null +++ b/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py @@ -0,0 +1,41 @@ +import logging +import threading +import time +import random + +LOG_FORMAT = '%(asctime)s %(threadName)-17s %(levelname)-8s %(message)s' +logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) + + +semaphore = threading.Semaphore(0) +item = 0 + + +def daftar(): + logging.info(' no daftar is waiting') + semaphore.acquire() + logging.info('daftar notify: non daftar pasien {}'.format(item)) + + +def periksa(): + global item + time.sleep(3) + item = random.randint(0, 20) + logging.info('periksa notify: no daftar {}'.format(item)) + semaphore.release() + + +def main(): + for i in range(8): + t1 = threading.Thread(target=daftar) + t2 = threading.Thread(target=periksa) + + t1.start() + t2.start() + + t1.join() + t2.join() + + +if __name__ == "__main__": + main() diff --git a/Chapter02/Event.py b/Chapter02/Event.py index 4cc0eca..35b6885 100644 --- a/Chapter02/Event.py +++ b/Chapter02/Event.py @@ -10,7 +10,7 @@ event = threading.Event() -class Consumer(threading.Thread): +class Pasien(threading.Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -19,10 +19,10 @@ def run(self): time.sleep(2) event.wait() item = items.pop() - logging.info('Consumer notify: {} popped by {}'\ + logging.info('Pasien notify: pasien {} menuju ruang dokter {}'\ .format(item, self.name)) -class Producer(threading.Thread): +class Dokter(threading.Thread): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -31,14 +31,14 @@ def run(self): time.sleep(2) item = random.randint(0, 100) items.append(item) - logging.info('Producer notify: item {} appended by {}'\ + logging.info('Dokter notify: dolter memeriksa pasien {}'\ .format(item, self.name)) event.set() event.clear() if __name__ == "__main__": - t1 = Producer() - t2 = Consumer() + t1 = Pasien() + t2 = Dokter() t1.start() t2.start() diff --git a/Chapter02/MyThreadClass.py b/Chapter02/MyThreadClass.py index 45e6fff..8d7795e 100644 --- a/Chapter02/MyThreadClass.py +++ b/Chapter02/MyThreadClass.py @@ -3,14 +3,14 @@ from random import randint from threading import Thread -class MyThreadClass (Thread): +class MyPasien (Thread): def __init__(self, name, duration): Thread.__init__(self) self.name = name self.duration = duration def run(self): print ("---> " + self.name + \ - " running, belonging to process ID "\ + " pasien diberikan no daftar "\ + str(os.getpid()) + "\n") time.sleep(self.duration) print ("---> " + self.name + " over\n") @@ -20,37 +20,19 @@ def main(): start_time = time.time() # Thread Creation - thread1 = MyThreadClass("Thread#1 ", randint(1,10)) - thread2 = MyThreadClass("Thread#2 ", randint(1,10)) - thread3 = MyThreadClass("Thread#3 ", randint(1,10)) - thread4 = MyThreadClass("Thread#4 ", randint(1,10)) - thread5 = MyThreadClass("Thread#5 ", randint(1,10)) - thread6 = MyThreadClass("Thread#6 ", randint(1,10)) - thread7 = MyThreadClass("Thread#7 ", randint(1,10)) - thread8 = MyThreadClass("Thread#8 ", randint(1,10)) - thread9 = MyThreadClass("Thread#9 ", randint(1,10)) + thread1 = MyPasien("no daftar pasien ", randint(1,10)) + thread2 = MyPasien("no daftar pasien", randint(1,10)) + # Thread Running thread1.start() thread2.start() - thread3.start() - thread4.start() - thread5.start() - thread6.start() - thread7.start() - thread8.start() - thread9.start() + # Thread joining thread1.join() thread2.join() - thread3.join() - thread4.join() - thread5.join() - thread6.join() - thread7.join() - thread8.join() - thread9.join() + # End print("End") diff --git a/Chapter02/MyThreadClass_lock_2.py b/Chapter02/MyThreadClass_lock_2.py index 2b44f98..e2b9e4f 100644 --- a/Chapter02/MyThreadClass_lock_2.py +++ b/Chapter02/MyThreadClass_lock_2.py @@ -7,20 +7,20 @@ # Lock Definition threadLock = threading.Lock() -class MyThreadClass (Thread): - def __init__(self, name, duration): - Thread.__init__(self) +class MyPasien (Thread): + def _init_(self, name, duration): + Thread._init_(self) self.name = name self.duration = duration def run(self): #Acquire the Lock threadLock.acquire() print ("---> " + self.name + \ - " running, belonging to process ID "\ + " pasien, ID pasiens "\ + str(os.getpid()) + "\n") threadLock.release() time.sleep(self.duration) - print ("---> " + self.name + " over\n") + print ("---> " + self.name + " selesai\n") #Release the Lock @@ -28,43 +28,26 @@ def main(): start_time = time.time() # Thread Creation - thread1 = MyThreadClass("Thread#1 ", randint(1,10)) - thread2 = MyThreadClass("Thread#2 ", randint(1,10)) - thread3 = MyThreadClass("Thread#3 ", randint(1,10)) - thread4 = MyThreadClass("Thread#4 ", randint(1,10)) - thread5 = MyThreadClass("Thread#5 ", randint(1,10)) - thread6 = MyThreadClass("Thread#6 ", randint(1,10)) - thread7 = MyThreadClass("Thread#7 ", randint(1,10)) - thread8 = MyThreadClass("Thread#8 ", randint(1,10)) - thread9 = MyThreadClass("Thread#9 ", randint(1,10)) + thread1 = MyPasien("daftar pasien {}", randint(1,10)) + thread2 = MyPasien("daftar pasien {}", randint(1,10)) + # Thread Running thread1.start() thread2.start() - thread3.start() - thread4.start() - thread5.start() - thread6.start() - thread7.start() - thread8.start() - thread9.start() + # Thread joining thread1.join() thread2.join() - thread3.join() - thread4.join() - thread5.join() - thread6.join() - thread7.join() - thread8.join() - thread9.join() + + # End print("End") #Execution Time - print("--- %s seconds ---" % (time.time() - start_time)) + print("--- %s detik ---" % (time.time() - start_time)) if __name__ == "__main__": @@ -72,4 +55,5 @@ def main(): - + +#class_lock2 \ No newline at end of file diff --git a/Chapter02/Rlock.py b/Chapter02/Rlock.py index 25bc64b..ffcda88 100644 --- a/Chapter02/Rlock.py +++ b/Chapter02/Rlock.py @@ -3,7 +3,7 @@ import random -class Box: +class Periksa: def __init__(self): self.lock = threading.RLock() self.total_items = 0 @@ -20,33 +20,33 @@ def remove(self): with self.lock: self.execute(-1) -def adder(box, items): - print("N° {} items to ADD \n".format(items)) +def adder(periksa, items): + print("Banyaknya orang periksa hari ini {} jumlah to ADD \n".format(items)) while items: - box.add() + periksa.add() time.sleep(1) items -= 1 - print("ADDED one item -->{} item to ADD \n".format(items)) + print("jumlah pendaftar saat ini -->{} org \n".format(items)) -def remover(box, items): - print("N° {} items to REMOVE \n".format(items)) +def remover(periksa, items): + print("banyaknya org yang selesai di periksa{} no periksa to REMOVE \n".format(items)) while items: - box.remove() + periksa.remove() time.sleep(1) items -= 1 - print("REMOVED one item -->{} item to REMOVE \n".format(items)) + print("pasien sudah selesai melakukan pemeriksaan -->{} jml \n".format(items)) def main(): items = 10 - box = Box() + periksa = Periksa() t1 = threading.Thread(target=adder, \ - args=(box, random.randint(10,20))) + args=(periksa, random.randint(10,20))) t2 = threading.Thread(target=remover, \ - args=(box, random.randint(1,10))) + args=(periksa, random.randint(1,10))) t1.start() t2.start() diff --git a/Chapter02/Semaphore.py b/Chapter02/Semaphore.py index 446088d..67580b3 100644 --- a/Chapter02/Semaphore.py +++ b/Chapter02/Semaphore.py @@ -11,24 +11,24 @@ item = 0 -def consumer(): - logging.info('Consumer is waiting') +def daftar(): + logging.info('pasien menunggu no daftar') semaphore.acquire() - logging.info('Consumer notify: item number {}'.format(item)) + logging.info('daftar notify: item number {}'.format(item)) -def producer(): +def periksa(): global item time.sleep(3) item = random.randint(0, 1000) - logging.info('Producer notify: item number {}'.format(item)) + logging.info('periksa notify: item number {}'.format(item)) semaphore.release() def main(): for i in range(10): - t1 = threading.Thread(target=consumer) - t2 = threading.Thread(target=producer) + t1 = threading.Thread(target=daftar) + t2 = threading.Thread(target=periksa) t1.start() t2.start() diff --git a/Chapter02/Thread_definition.py b/Chapter02/Thread_definition.py index 3797983..a31b06a 100644 --- a/Chapter02/Thread_definition.py +++ b/Chapter02/Thread_definition.py @@ -1,14 +1,14 @@ import threading -def my_func(thread_number): - return print('my_func called by thread N°{}'.format(thread_number)) +def pasien(thread_number): + return print('pasien called by dokter {}'.format(thread_number)) def main(): threads = [] for i in range(10): - t = threading.Thread(target=my_func, args=(i,)) + t = threading.Thread(target=pasien, args=(i,)) threads.append(t) t.start() t.join() diff --git a/Chapter02/Thread_name_and_processes.py b/Chapter02/Thread_name_and_processes.py index ae78e30..e21b7f8 100644 --- a/Chapter02/Thread_name_and_processes.py +++ b/Chapter02/Thread_name_and_processes.py @@ -2,28 +2,34 @@ import time import os -class MyThreadClass (Thread): +class MakananClass (Thread): def __init__(self, name): Thread.__init__(self) self.name = name def run(self): - print("ID of process running {}".format(self.name)) #, " is {} \n".format(os.getpid())) + print("Makanan Khas Sumut {}".format(self.name)) #, " is {} \n".format(os.getpid())) def main(): from random import randint # Thread Creation - thread1 = MyThreadClass("Thread#1 ") - thread2 = MyThreadClass("Thread#2 ") + thread1 = MakananClass("Mie Gomak ") + thread2 = MakananClass("Sambal Tuktuk") + thread3 = MakananClass("Bika Ambon") + thread4 = MakananClass("Sumur Jengkol ") # Thread Running thread1.start() thread2.start() + thread3.start() + thread4.start() # Thread joining thread1.join() thread2.join() + thread3.join() + thread4.join() # End print("End") From 64b63275c795b303de12ca1b20aec5876bb154f7 Mon Sep 17 00:00:00 2001 From: ayulestarinasution Date: Wed, 20 Apr 2022 14:01:34 +0700 Subject: [PATCH 4/4] 1194007_Ayu_Lestari_Nasution_Quis --- .../MyThreadClass_lock_2sk.py | 26 +++++--------- .../MyThreadClass_locksk.py | 35 +++++++++---------- .../MyThreadClassk.py | 0 .../Rlocksk.py | 0 .../Thread_definitionsk.py | 0 .../Threading_with_queuesk.py | 0 .../barier.py | 0 .../conditionsk.py | 0 .../eventsk.py | 0 .../studykasusThread_determine.py | 0 .../studykasusThread_name_and_processes.py | 0 .../studykasussemaphore.py | 0 12 files changed, 25 insertions(+), 36 deletions(-) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/MyThreadClass_lock_2sk.py (60%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/MyThreadClass_locksk.py (57%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/MyThreadClassk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/Rlocksk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/Thread_definitionsk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/Threading_with_queuesk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/barier.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/conditionsk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/eventsk.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/studykasusThread_determine.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/studykasusThread_name_and_processes.py (100%) rename {Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus => QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus}/studykasussemaphore.py (100%) diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py similarity index 60% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py index 16fc72f..0e49079 100644 --- a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py +++ b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_lock_2sk.py @@ -15,28 +15,24 @@ threadLock = threading.Lock() class MyPasien (Thread): - def _init_(self, name, duration): - Thread._init_(self) + def __init__(self, name, duration): + Thread.__init__(self) self.name = name self.duration = duration def run(self): - #Acquire the Lock - threadLock.acquire() print ("---> " + self.name + \ - " pasien, ID pasiens "\ + " pasien diberikan no daftar "\ + str(os.getpid()) + "\n") - threadLock.release() time.sleep(self.duration) - print ("---> " + self.name + " selesai\n") - #Release the Lock + print ("---> " + self.name + " sudah di berikan\n") def main(): start_time = time.time() # Thread Creation - thread1 = MyPasien("daftar pasien {}", randint(1,10)) - thread2 = MyPasien("daftar pasien {}", randint(1,10)) + thread1 = MyPasien("pasien notify: ", randint(1,10)) + # Thread Running @@ -49,18 +45,12 @@ def main(): thread2.join() - - # End + # End print("End") #Execution Time - print("--- %s detik ---" % (time.time() - start_time)) + print("--- %s seconds ---" % (time.time() - start_time)) if __name__ == "__main__": main() - - - - -#class_lock2 \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py similarity index 57% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py index ec6afe6..5b0e0a1 100644 --- a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py +++ b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClass_locksk.py @@ -14,46 +14,45 @@ # Lock Definition threadLock = threading.Lock() -class MyPasien(Thread): - def _init_(self, name, duration): - Thread._init_(self) +class MyPasien (Thread): + def __init__(self, name, duration): + Thread.__init__(self) self.name = name self.duration = duration def run(self): - #Acquire the Lock - threadLock.acquire() print ("---> " + self.name + \ - " no daftar adalah "\ + " pasien diberikan no daftar "\ + str(os.getpid()) + "\n") time.sleep(self.duration) - print ("---> " + self.name + " selesai diberikan no daftar\n") - #Release the Lock - threadLock.release() + print ("---> " + self.name + " over\n") def main(): start_time = time.time() + # Thread Creation - thread1 = MyPasien("no pasien ", randint(1,10)) - thread2 = MyPasien("pasien no ", randint(1,10)) - - + thread1 = MyPasien("no daftar pasien ", randint(1,10)) + thread2 = MyPasien("no daftar pasien", randint(1,10)) + # Thread Running thread1.start() thread2.start() - - + # Thread joining thread1.join() thread2.join() - - #Execution Time - print("waktu yang dibutuhkan untuk mengerjakan soal %s seconds soal" % (time.time() - start_time)) + # End + print("End") + + #Execution Time + print("--- %s seconds ---" % (time.time() - start_time)) if __name__ == "__main__": main() + + \ No newline at end of file diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/MyThreadClassk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Rlocksk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Thread_definitionsk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/Threading_with_queuesk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/barier.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/barier.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/barier.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/conditionsk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/eventsk.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_determine.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasusThread_name_and_processes.py diff --git a/Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py b/QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py similarity index 100% rename from Chapter02/1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py rename to QUIS SISTER 1/Quis_1194007_Ayu_Lestari_Nasution Study Kasus/studykasussemaphore.py