Re: [algogeeks] GOOG: Design a circular buffer and write the code for the reader and writer routines

2011-02-15 Thread pacific pacific
here is my approach. shared variables : in, out shared memory : buf[N] writer while(1) { while(in+1 % N ==out) { // waiting } buf[in+1]= input; in = in+1 % N } reader while(1) { while(out == in) { // waiting } output = buf[out] out = out+1 % N } On Tue, Feb

[algogeeks] GOOG: Design a circular buffer and write the code for the reader and writer routines

2011-02-15 Thread Ashish Goel
as i see this would need synchronization... anyone tried it so far? Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send em