Re: Multithreading with libssh

2019-09-26 Thread g4-lisz
H Simon, OK I understand now what you want to do. But I doubt that several threads in parallel are faster when each thread has to open the session. This is a lot of communication overhead, when it's to the same destionation. Last but not least it also depends on how the server side handles these

Re: Multithreading with libssh

2019-09-26 Thread Simon Moselewski
Hi Till, thanks for the quick answer. I want to collect the data as fast as possible. All channels are to the same destination. Problem is: You can only run one ssh_channel_request_exec per Channel. So I need 1500 channels. I would like to Open them as simultaneously as possible to Save time.

Re: Multithreading with libssh

2019-09-26 Thread g4-lisz
Hi Simon. You want to open the 1500 channels simultaneously? If not, then why you need more than one thread? And each channel is to a different destination? If not, then why opening a new session each time? You can't share the session between threads, but you can re-use it... IMHO it's simpler to

Multithreading with libssh

2019-09-26 Thread Simon Moselewski
Hi everyone, I am using libssh to connect to a remote host, run commands on it and read the results. Since I am doing this for 1500 commands I want to use threads to parallelize that. I am using gcc compiler with flags -libssh -pthread and -lssh_threads. My threadless approach was: open sessio