MS IDC interview question:

Given a memory location say from 0 - 1023. Now there are many threads that
are reading and writing in this memory locations at any time 0t 1t 2t ...
and so on.

For ex a thread no.4 is writing to memory location 512 at time 3t.
So we get a quadruple {4,512,W,3t}.

Suppose we have lot of quadruples for lots of threads.At any particular
time we have to tell which of the threads are doing memory clash.

Memory clash is defined as two thread accessing same memory location with
time difference less than equal to 5 and atleast one of the thread is doing
write operation.

That interviewer didnt needed the code bt the approach.I first told him to
hash the threads based on memory location and search for memory clash
threads for that memory location,bt he was not understanding how it can be
implemented for large no. of threads.
-- 
*Dheeraj Sharma*

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to