def get_matrix_b_block(self, start_row, start_column, end_row, end_column): """ access node's datastore to get the elements [from start_row][start_column] to [end_row][end_column] - for matrix b @return: the matrix with all the values between this limits """ thread = MyThread(self, start_row, start_column, end_row, end_column, 'b') thread.start() thread.join() return thread.block pass
def get_matrix_a_block(self, start_row, start_column, end_row, end_column): """ access node's datastore to get the elements [from start_row][start_column] to [end_row][end_column] - for matrix a @return: the matrix with all the values between this limits """ thread = MyThread(self, start_row, start_column, end_row, end_column, 'a') thread.start() thread.join() """ returns the matrix saved in thread's variable - block """ return thread.block pass
def multiple_download_pic(self,offsetlist): threads = [] for i in offsetlist: offset = i * self.count t = MyThread(func=self.download_pic_once,args=(offset,),name=i + 1) threads.append(t) for t in threads: t.start() for t in threads: t.join()