Sam Roberts
11/23/2004 3:44:00 AM
Quoteing james@grayproductions.net, on Tue, Nov 23, 2004 at 12:27:25PM +0900:
> On Nov 22, 2004, at 9:23 PM, Mark Probert wrote:
>
> >so, i can only assume that one of the other threads is writing to the
> >this string. Is this possible? Or is there some other way that the
> >passed string can become corrupt?
I had a bug recently with strings being corrupted, it was because
a string was shared, and was modified by another piece of code.
I don't know about your app, but perhaps you could freeze the strings
either before you pass them to telnet, or inside telnet, which would
allow you to detect the modfier, if thats whats happening.
Cheers,
sam
> This sounds like the Threads are sharing this String resource. Did it
> exist outside of the Threads when you created them? If so, did you
> pass into the Thread with something like:
>
> Thread.new(outer_string) do |thread_local_string|
> # ...
> end
>
> ?
>
> James Edward Gray II
>
>