Re: [Gambas-user] Multithreaded Programs
Brought to you by:
gambas
|
From: Benoît M. <g4...@gm...> - 2018-05-31 21:37:36
|
Le 31/05/2018 à 23:27, MacGyver via Gambas-user a écrit : > I will give you a real life example of the need for multithreading. > > project to monitor status of computers on a network. this is done with a > ping to each system from a timer. the result is either online or offline > depending on ping results. The program is unresponsive to the user while > multiple pings are done in the background. multithreading would allow the > program to be responsive to users while other computer status is checked in > another thread. furthermore if for some reason a person had 100 systems to > monitor on the network, this will take time if many are in offline status > leaving the program unresponsive to users for quite some time. creating 100 > threads each pinging only one system then terminating after returning the > result would make it even faster as all pings are done simultaneously. > > So there is but one real world application for multithreading. not to > mention it would make gambas immensely more powerful. > "A Computer is a state machine. Threads are for people who can't program state machines." - Alan Cox. :-) -- Benoît Minisini |