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

libssh thread support


I'm considering using libssh in an application I'm developing.  I would
be using libssh to execute a program on the server, and my application
would then speak an application-specific binary protocol with that
program.  In this protocol, the requests and responses are asynchronous,
so I would have a reader thread that reads "responses" from the ssh
connection, while the main thread writes "requests" to it.  Is this
possible with libssh?  Would I need locking so that a read and a write
don't occur simultaneously?

In the libssh tutorial, I see the following:

"At all times, you may use different sessions inside threads, make
parallel connections, read/write on different sessions and so on. You
can use a single session in several channels at the same time. This will
lead to internal state corruption. This limitation is being worked out
and will maybe disappear later."

Could you please clarify this statement?  I don't think it is clear what
it is exactly that will lead to internal state corruption.

Thanks,
Andrew

Follow-Ups:
Re: libssh thread supportAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org