From: "Ara.T.Howard" Date: 2006-07-07T01:26:41+09:00 Subject: Re: [BUG] thread/sync.rb memory corruption ------=_Part_40431_17060414.1152202634357 Content-Type: MULTIPART/MIXED; BOUNDARY="----=_Part_40431_17060414.1152202634357" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ------=_Part_40431_17060414.1152202634357 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: Content-Disposition: INLINE On Thu, 6 Jul 2006, Robert Klemme wrote: > With queued I meant something different in this case, i.e. have a single > event queue in the obervable that is processed by a single thread only. > Well, yes. Still I think that the design is flawed because there is a > recursion via threads. If you have two listeners the # of threads will > constantly grow. Try it out! I tried it with these changes (attached). > Probably your version crashes with a single listener because threads are not > as fast GC'ed as on my machine or whatever. agreed. this is actually the model i am using in the real code. note that this code is simply a minimal example which triggers the bug. regardless of whether it's a bad design or not (which it is) memory should not be corrupted by a simply ruby script - if so i think it's a bug. note that it's not that it simple gets slow that i'm showing - if you run under electric fence is shows actual memory corruption - same with valgrind. > Try my changes. More and more threads queue up at the mutex. oh i know - that's how the real code works - with a Queue and a single thread consumer. > Btw, it does not crash on cygwin - neither way. :-) huh. suprising. do you have electric fence? you cannot make it crash without it unless you wait a very long time. > Weird indeed. yes - this is the issue that concerns me. cheers. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama ------=_Part_40431_17060414.1152202634357 Content-Type: APPLICATION/X-RUBY; NAME=cr.rb Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME=cr.rb IyEgL3Vzci9iaW4vcnVieQoKcmVxdWlyZSAnc3luYycKCmNsYXNzIEEKCiAgZGVmIGluaXRpYWxp emUKICAgIGV4dGVuZCBTeW5jX20KICAgIEBvYnNlcnZlcnMgPSBbXQogIGVuZAoKICBkZWYgbWV0 aAogICAgc3luY2hyb25pemUoOkVYKXsKICAgICAgcCBUaHJlYWQubGlzdC5zaXplCgogICAgICBA b2JzZXJ2ZXJzLmVhY2ggZG8gfG98CiAgICAgICAgaWYgRU5WWydDT1JSVVBUJ10KICAgICAgICAg IG8ubm90aWZ5IG5pbAogICAgICAgIGVsc2UKICAgICAgICAgIG8ubm90aWZ5CiAgICAgICAgZW5k CiAgICAgIGVuZAogICAgfQogIGVuZAoKICBkZWYgYWRkX29ic2VydmVyIG8KICAgIHN5bmNocm9u aXplKDpFWCl7CiAgICAgIEBvYnNlcnZlcnMgPDwgbwogICAgfQogIGVuZAplbmQKCmNsYXNzIEIK ICBkZWYgaW5pdGlhbGl6ZSBhCiAgICBAYSA9IGEKICAgIEBhLmFkZF9vYnNlcnZlciBzZWxmCiAg ZW5kCgogIGRlZiBub3RpZnkgKmEKICAgIFRocmVhZC5uZXd7IEBhLm1ldGggfQogIGVuZAplbmQK CmEgPSBBLm5ldwpiID0gQi5uZXcgYQpjID0gQi5uZXcgYQphLm1ldGgKU1RESU4uZ2V0cwo= ------=_Part_40431_17060414.1152202634357-- ------=_Part_40431_17060414.1152202634357--