[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] Embedding tor in an application and using tor without opening a port



On Mon, Apr 15, 2013 at 8:01 AM, Nick Mathewson <nickm@xxxxxxxxxxxx> wrote:
Tor isn't multithreaded like that. Its main thread uses an asynchonous
event loop.
Ah, I see. 

I'd make a command queue structure that any thread could use to
asynchronously send commands to the main thread, so that the only
change you'd need to make in the main thread would be enough locking
to handle queued commands and to queue replies.  That way the codebase
changes would be much simpler.

In fact, that's how the controller interface works.
I was actually thinking along the same lines but I thought that tor also has a command queue for SOCKS connections so the library could just add data to Tor's queue.

Regards,
Navin
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev