Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. package memoizer
  2.  
  3. import (
  4. "github.com/61c-teach/sp18-proj5"
  5. )
  6.  
  7. /* The simplest possible implementation that does anything interesting.
  8. This doesn't even do memoization, it just proxies requests between the client
  9. and the classifier. You will need to improve this to use the cache effectively. */
  10. func Memoizer(memHandle proj5.MnistHandle, classHandle proj5.MnistHandle, cacheHandle proj5.CacheHandle) {
  11.  
  12. for req := range memHandle.ReqQ {
  13. classHandle.ReqQ <- req
  14. resp := <-classHandle.RespQ
  15. memHandle.RespQ <- resp
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement