On Wednesday, February 29, 2012 8:37:45 PM UTC-8, Nels Nelson wrote: > > I hope this is a sufficient example of my problem. The threads here > are supposed to represent network communication processes that get > kicked off in handlers that are given for async network IO managed by > a pool of cached worker threads. > > https://gist.github.com/1947131 > > Of course, the variables a, b, and c are would not be available to > both threads in the real program, and are only in the second Thread > execution block to highlight the problem which I am trying to explain.
Thanks for putting together the example. The main issue you are running into is that you aren't wrapping your code in a Test.with_identity_map block (see http://sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Plugins/IdentityMap.html), so you aren't actually using an identity map at all. The next issue is that the identity map does not know about objects created outside of the with_identity_map block. Also, you probably want to use create_table? instead of create_table! unless table_exists?. I've forked and edited your gist fixing these issues: https://gist.github.com/1951186 Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/RTafTW8HSioJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
