threading
-
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
-
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
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 )
-
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 )
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
-
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
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!]