multi-thread environment???
Created by: lestcape
The only thing I found really annoying is the amount of times that PAMAC locks with lock_file since pylamp also has its own lock. I propose to change its blockade by a multi-thread environment where threads lock in the daemon when some client access to danger zones. This will give you the ease of graphical interface completely separate business, giving greater flexibility to the application. In a multithreaded enviroment, the thread started by client notifies the thread that is waiting for data (possibly confirmation of a transition).
def EmitTransactionConfirmation(self, info_config):
self.emit("EmitTransactionConfirmation", info_config)
self.client_response = False
self.client_condition.acquire()
while not self._client_confirm_trans():
self.client_condition.wait()
self.client_condition.release()
def Release(self):
try:
if not self.client_response:
self.client_condition.acquire()
self.client_condition.notify()
self.client_response = True
self.client_condition.release()
self.t.release()
self.lock_trans.release()
except:
pass
def Commit(self):
if not self.client_response:
self.client_condition.acquire()
self.client_condition.notify()
self.client_response = True
self.client_condition.release()
error = ''
def prepare_transaction_install(self, pkgs, cascade = True, recurse = False):
self.lock_trans.acquire()
self.to_add = set()
self.to_update = set()
self.to_load = set()
self.to_remove = set()