Let two process function1, function2 are running at the same time. function1// continuously appending the list function2// take that the list from function1 and get all the data from the list and copy to another list, flush the original list and process that copied list.
sample code: list_p =[] def function1(data): list_p.append(data) def function2(list_p): list_q = list_p.copy() list_p.flush() x= process(list_q) return x while True: //coming data continously function1(coming data) So, how to work with both function1 and function2 at a time so that I can get the data from function1 and flush it (after flushing start appending the index in function1 from 0) Also, at the same time list could be appending in function1.
At the same time, function1 could be appending the list and function 2 could be processing the new list, after finishing function2's process, It again takes all the data in the original list that was appending while function2 was processing.
continue..
process()is calling.