[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is libssh thread safe


The scenario you described is quite stable right now and it also 
seems quite fast too me. Sure avoiding the authentication and 
crateion of channel everytime would save you time, but it would 
advise against it at the moment.
I don't have hard numbers on the performance yet since my main 
concern was stabilty, but I will surely look into the overall 
performance in the future.

> Thanks Aris.
> 
> So, that means, everytime I want to execute a remote command, if I create a
> separate thread, and create a new session and a channel dedicated for this
> thread, then executing remote command with this session/channel will be
> safe, and each thread will work fine without impacting others, right?
> 
> Why I asked that use case is for performance concern, my program will rely
> on libssh to do a lot of remote command execution on the same remote host,
> and each command will be done in a separate thread. So in each thread,
> creating a dedicated session/channel and do the login with username/password
> looks not good from performance point view, so I am wondering if I can keep
> a global session/channel, and just do login one time before I create any
> threads to execute any command remotely.
> 
> Any suggestions on my use case? Thanks!
> 



References:
Is libssh thread safeZhang Qian <zhq527725@xxxxxxxxx>
Re: Is libssh thread safeAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: Is libssh thread safeZhang Qian <zhq527725@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org