in reply to How to pass a object value to global array in threads

As I told you in Re: Invalid value for shared scalar -while assigning object value to array - In Threads, what you are trying to do won't work.

Not because of all the simple syntax errors you are making; but because performing concurrent operations on a single shared telnet session simply does not work. Telnet sessions are not designed to be shared.

I even pointed you at Re: How do you share an object(Telnet Session) between threads? that explains why it won't work in more detail; and why it is completely unnecessary to share telnet sessions anyway.

YOu are trying to do the wrong thing the wrong way; and there is a much simpler solution to your problem if you would take the time to understand it.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: How to pass a object value to global array in threads

Replies are listed 'Best First'.
Re^2: How to pass a object value to global array in threads
by gjoshi (Sexton) on Oct 26, 2015 at 09:07 UTC

    Yes I am trying to do wrong thing. but I am not able to get is in the explanation that 4rth thread will return the information to calling thread. but again i will be having same problem using that handle. See my problem is because of legacy code. I required to store all the telnet handle to an global array and that array of handles is used every where. so with your solution i will also have same problem.

    May be my question how to get all telnet start at a same time and get it handle stored in a array for further use. Is there is any better way to do it?

      See my problem is because of legacy code. I required to store all the telnet handle to an global array and that array of handles is used every where.

      That simply makes no sense. If modern code (of any type or language) cannot successfully make concurrent use of a shared telnet session; neither can legacy code.

      And if you cannot use the telnet handle concurrently, there is no reason and it makes no sense, to store them in a shared global array.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.