Pekka Pessi a écrit :
On 3/31/06, Thomas Rosenblatt <[EMAIL PROTECTED]> wrote:
I'm still working on the Sofia-resolver, and I have some trouble with
the multi-threading management in Sofia.
In my case I have a program that is listening on an IPC message queue.
This program receives addresses from queue and have to solve them
(following the RFC3263).
I have then modified Sofia to fit my goals.
With one thread I have no problem, the resolver is working properly. I
mean it receives a message from queue, resolve the address and return to
the application.
The resolver is working like this:
call of the a function :
resolve(char *address);
and then it makes an infinite loop to listen for DNS answers :
while(resolution is not finished)
su_root_step(my_root_object,500L);
and it handles the results.
I have tried several things to use multi threads, but without any
success. ( Assertion `(su_port_own_thread(parent->sur_task->sut_port))'
failed. )
I can not launch a su_clone_start(my_root_object), in a different thread.
How can I resolve simultaneously several DNS addresses?
The sres_resolver_t object in 1.11.7 does not multithread nicely, unfortunately.
But you can run any number of queries from the single thead, just
start new query and keep running in the su_root_step() loop until all
of them are complete.
I have tried to make a new, more thread-friendly interface, which is
in the experimental repo in
<http://dev-126.openlaboratory.net/repos/bleeding-sofia-sip/>. In the
new interface is that there can be multiple sres_resolver_t instances,
each using the same cached data. Each thread can have its own
instance, which it can use freely. The sres code takes care of locking
and so on.
--Pekka
--
Pekka.Pessi mail at nokia.com
Thank you Pekka,
I finally managed the problem, by creating the query directly in the
loop, using one single thread, and shared variables:)
Thomas Rosenblatt.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel