1. Nick Wade
  2. OCaml Map Reduce Project

Commits

Nick Wade  committed 0809891

Post office hours update on data structures - implementing tomorrow

  • Participants
  • Parent commits 8ad373c
  • Branches master

Comments (0)

Files changed (1)

File controller/map_reduce.ml

View file
 
 
 (* Idea of execution of map *)
-(* initialize worker manager
-initialize thread pool
-
-for each (id,body) pair in kv_pair, add it to QUEUE1/LIST1
-for each (id,body) pair in QUEUE1/LIST1
-  pop a worker, give it the pair to work on in a new thread
-  if it fails, add (id, body) back to QUEUE1/LIST1
-  if it suceeds, add returned data to QUEUE2/LIST2 and push worker back to manager *)
+(* initialize worker manager *)
+(* initialize thread pool *)
+(* initialize a ref list *)
+(* for each (id,body), 
+  assign it to a new worker on new thread, 
+  add to hashtable in safe manner with worker as key, (id, body) as value *)
+(* if worker is successful, 
+    remove from table, append result to list in safe manner, push worker
+   if worker is unsuccessful, remove from table, try with new worker *)  
   
-  
-  (* For combine, use the hash table *)
+(* For combine, use the hash table with key as key, incrementing value  *)
 
 
 let combine kv_pairs : (string * string list) list =