Hi , im trying to do scheduling between two process/threads that I have one shared memory , one process is writing and other process is reading, I have function void write , and function void read ; so what I need to do is to synchronize between two process in order to not having deleted data or any concurrency OS issues,
what I have did is to do global flag variable called Enable, int Enable =0 ; and say if Enable ==0 then just -write function - can write , other wise Enable=1 then just - Read function - can work ; but I didn't find that technique is a good solution for synchronize between two threads. could anyone tell me any suggestion how could I synchronize between two threads? or any suggestion with my flag synchronize between two threads/processes? thanks alot
By the way I must not use mutex/semaphore on that question , all what I need is to do synchronize between two threads on one shared memory, one is reading and the other is writting.
thanks for helping me guys.