Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. threading

threading

Scheduled Pinned Locked Moved Visual Basic
cssdatabasehelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    balakpn
    wrote on last edited by
    #1

    hi i am doing a tool in which i have to open some ten to twenty telnet sessions in each seperate users will be sigining on and accssing same area and database.using a telnet component i am creating telnet session and giing som inputs and retriving data to gui. for making the process i am using threading.but it takes more time for a single command thats more tha 2 sec which will be taking less tha a second if we open single telnet session could any one tell me the reason pls? and help me with some advanced threading concepts and sample codes pls thanks

    with regards Balagurunathan.B

    C 1 Reply Last reply
    0
    • B balakpn

      hi i am doing a tool in which i have to open some ten to twenty telnet sessions in each seperate users will be sigining on and accssing same area and database.using a telnet component i am creating telnet session and giing som inputs and retriving data to gui. for making the process i am using threading.but it takes more time for a single command thats more tha 2 sec which will be taking less tha a second if we open single telnet session could any one tell me the reason pls? and help me with some advanced threading concepts and sample codes pls thanks

      with regards Balagurunathan.B

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Threading does not magically turn your processor into 20 processors. It simply divides a number of tasks to be performed by the one processor. It won't make things faster than if you did them all in the main thread, it's main advantage is in making sure the UI thread remains active so the program does not freeze.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      B 1 Reply Last reply
      0
      • C Christian Graus

        Threading does not magically turn your processor into 20 processors. It simply divides a number of tasks to be performed by the one processor. It won't make things faster than if you did them all in the main thread, it's main advantage is in making sure the UI thread remains active so the program does not freeze.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        B Offline
        B Offline
        balakpn
        wrote on last edited by
        #3

        thanks i am also able to understand wat u r saying but my only concern is it should not reduce the speed and make a which will only take less than a second to more or less three seconds i tried with less no of sessions also means prviously i said i used 10 sec but later i tried with 5 seconds but there is no change in retrival thats why i am getting confused. will you please send me some links which can give me a better knowledge abt threading for me in vb.net thanks

        with regards Balagurunathan.B

        M 1 Reply Last reply
        0
        • B balakpn

          thanks i am also able to understand wat u r saying but my only concern is it should not reduce the speed and make a which will only take less than a second to more or less three seconds i tried with less no of sessions also means prviously i said i used 10 sec but later i tried with 5 seconds but there is no change in retrival thats why i am getting confused. will you please send me some links which can give me a better knowledge abt threading for me in vb.net thanks

          with regards Balagurunathan.B

          M Offline
          M Offline
          MidwestLimey
          wrote on last edited by
          #4

          As Mr. Graus pointed out, adding more threads will not speed up a uni-cored machine and has no guarentee of working on more then one core of a multi-cored machine (that's up to the OS). Adding more threads then cores WILL slow down the machine since each thread's context (the various registers, caches etc) will have to copied to the CPU and then taken from the CPU on each swap. It's called a context switch. 20 threads on 1 core means 20 context switches which adds overhead. Threads just guarentee that some of your code gets a time-slice and isn't frozen until another thread completes. Such uses are typically for the UI (users hate frozen interfaces) and server apps. I'm also baffled as to why you're using telnet protocol for data transfers?? Felt the need to post something today ;) [sorry, mispelled your name!]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups