Re: Newbie problem
From: Johan Bondeson <johan@xxxxxxxxxxxxxxxx>
Date: Tue, 18 Oct 2005 16:38:08 +0200

Hi
AFAIK gloox should not have problems with threads. I myself have had several clients and components communicating with each other using different threads. A thing that comes to mind is the roster storage, but I se no reason for you to tamper with it in a way that would risk thread safety.

The thing you should watch out for is as always that your own code need to be thread safe. For instance if you store stuff in lists (vectors, maps etc.) that you loop through and modify, you'll probably need some locks on the code, but I cant say really since I don't know about your implementation.

/Johan

I was also wondering whether gloox is threadsafe.  Can I spawn a thread
to handle the event loop and then send messages asynchronously through the
same client object in my main thread?  Is there example code to illustrate
that?  I'll probably be using the boost thread class, but other thread
libs should convey the needed information.

I have the functionality that I need in Perl using the Net::Jabber
module, but I want to do this in C++ to reduce memory footprint on a
resource-constrained device.



--
gloox-dev mailing list
to unsubscribe:
send a message with subject 'unsubscribe gloox-dev' to minimalist@xxxxxxxxxx