Menu

Multi Threading

Help
Hosi
2008-07-30
2013-04-24
  • Hosi

    Hosi - 2008-07-30

    Please give me an example about multi threading, both in server and client. I know there is post in the forum but I want an example :)
    Waiting for ur answer
    Thanks

     
    • Freddy Castro

      Freddy Castro - 2008-07-30

      Hi, I am User Debian, I have installed libxmlrpc++0 version: 0.7+cvs20040713-2.

      I use XmlRpcServer class and I don't problem. But when use XmlRpcThreadedServer and compile my code, I have the next output:

      g++  -g -Wall -D\_REENTRANT   -I./   server.cpp /usr/lib/libxmlrpc++.so /usr/lib/libssl.so /usr/lib/libACE.so   -lxmlrpc++ -lssl -lACE -o server
      /tmp/cc5SSLNz.o: In function `Worker':
      /usr/include/XmlRpcThreadedServer.h:39: referencia a `vtable for XmlRpc::XmlRpcThreadedServer::Worker' sin definir
      /usr/include/XmlRpcThreadedServer.h:42: referencia a `vtable for XmlRpc::XmlRpcThreadedServer::Worker' sin definir
      /usr/include/XmlRpcThreadedServer.h:42: referencia a `XmlRpc::XmlRpcThread::start()' sin definir
      /usr/include/XmlRpcThreadedServer.h:42: referencia a `XmlRpc::XmlRpcThread::~XmlRpcThread()' sin definir
      /tmp/cc5SSLNz.o: In function `~Worker':
      /usr/include/XmlRpcThreadedServer.h:39: referencia a `vtable for XmlRpc::XmlRpcThreadedServer::Worker' sin definir
      /usr/include/XmlRpcThreadedServer.h:39: referencia a `XmlRpc::XmlRpcThread::~XmlRpcThread()' sin definir
      /tmp/cc5SSLNz.o: In function `~XmlRpcThreadedServer':
      /usr/include/XmlRpcThreadedServer.h:25: referencia a `XmlRpc::XmlRpcMutex::~XmlRpcMutex()' sin definir
      /usr/include/XmlRpcThreadedServer.h:25: referencia a `XmlRpc::XmlRpcMutex::~XmlRpcMutex()' sin definir
      collect2: ld returned 1 exit status
      make: *** [server] Error 1

      This output indicate the libxmlrpc++0 libraries' errors but don't indicate errors in my code.
      I don't know XmlRpcThreadedServer examples and I should like to know one or more.

      Thanks!!!!!!

      PD: Sorry for my English Syntax. I don't speak English very well.

       
    • Hosi

      Hosi - 2008-07-31
       
    • quique123

      quique123 - 2008-08-11

      The problem of multi-threading: that is a part that is OS dependent, that means, windows has its own implementation, the same with linux, solaris, etc.

      Therefore, I recommend you to use the XmlRpcClient class and do by yourself the multithreading part.

      If you do not have any clue about how to do it, just answer with OS and Compiler, and maybe I can help you...

      José

       
    • Hosi

      Hosi - 2008-08-15

      Hi and thanks for your answers :) You are right, Multi-Threading is OS dependent, but I think BOOST has fixed it in many ways. Boost is and cross-platform libraries for C++. I think you can use that and release an Multi-Thread version of XML-RPC++. Can you do it ?

       
      • Piotrek

        Piotrek - 2008-08-15

        I don't think adding a boost dependency to this library will be a good idea. It's ok for your specific application, but I think this library should be as stand-alone as possible. I think something similar to what ACE has done should be done with this library (implementation of OS-specific multithreading wrapper mechanisms) to keep it stand-alone and multithreading-capable (in fact, my application is using ACE wrappers  to facilitate multithreading).
        Good luck!
        P

         

Log in to post a comment.