diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/accessproxy.cpp tango_805.p2/lib/cpp/client/accessproxy.cpp
--- tango_805.p1/lib/cpp/client/accessproxy.cpp	2012-09-10 14:17:54.926981489 +0200
+++ tango_805.p2/lib/cpp/client/accessproxy.cpp	2012-10-25 10:30:57.654748391 +0200
@@ -122,6 +122,8 @@
 	bool multi_ip = true;
 	bool two_tries = false;
 
+	omni_mutex_lock oml(only_one);
+
 	while (two_tries == false)
 	{
 		try
diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/accessproxy.h tango_805.p2/lib/cpp/client/accessproxy.h
--- tango_805.p1/lib/cpp/client/accessproxy.h	2012-09-10 14:17:54.822980904 +0200
+++ tango_805.p2/lib/cpp/client/accessproxy.h	2012-10-25 10:30:47.446698434 +0200
@@ -48,6 +48,7 @@
 	vector<string>					host_ips;
 	bool							forced;
 	map<string,vector<string> > 	allowed_cmd_table;
+	omni_mutex						only_one;
 
 	void get_allowed_commands(string &,vector<string> &);
 
diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/api_util.cpp tango_805.p2/lib/cpp/client/api_util.cpp
--- tango_805.p1/lib/cpp/client/api_util.cpp	2012-09-10 14:17:54.810980836 +0200
+++ tango_805.p2/lib/cpp/client/api_util.cpp	2012-10-25 10:30:32.394624644 +0200
@@ -1489,6 +1489,8 @@
 
 void ApiUtil::get_ip_from_if(vector<string> &ip_adr_list)
 {
+	omni_mutex_lock oml(lock_th_map);
+
     if (ext->host_ip_adrs.empty() == true)
     {
 #ifndef _TG_WINDOWS_
diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/eventconsumer.h tango_805.p2/lib/cpp/client/eventconsumer.h
--- tango_805.p1/lib/cpp/client/eventconsumer.h	2012-09-10 14:17:54.802980791 +0200
+++ tango_805.p2/lib/cpp/client/eventconsumer.h	2012-10-25 10:30:32.394624644 +0200
@@ -513,6 +513,7 @@
     DevErrorList_var                        del;
 
     int                                     old_poll_nb;
+	omni_mutex								subscription_mutex;
 
 	void *run_undetached(void *arg);
 	void push_heartbeat_event(string &);
diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/eventkeepalive.cpp tango_805.p2/lib/cpp/client/eventkeepalive.cpp
--- tango_805.p1/lib/cpp/client/eventkeepalive.cpp	2012-09-10 14:17:54.818980881 +0200
+++ tango_805.p2/lib/cpp/client/eventkeepalive.cpp	2012-10-25 10:30:32.394624644 +0200
@@ -960,7 +960,6 @@
 												DeviceAttribute *da = NULL;
 												DevErrorList err;
 												err.length(0);
-												string domain_name = epos->second.device->dev_name() + "/" + epos->second.attr_name;
 
 												bool old_transp = epos->second.device->get_transparency_reconnection();
 												epos->second.device->set_transparency_reconnection(true);
diff -Naur '--exclude=.svn' tango_805.p1/lib/cpp/client/zmqeventconsumer.cpp tango_805.p2/lib/cpp/client/zmqeventconsumer.cpp
--- tango_805.p1/lib/cpp/client/zmqeventconsumer.cpp	2012-09-10 14:17:54.802980791 +0200
+++ tango_805.p2/lib/cpp/client/zmqeventconsumer.cpp	2012-10-25 10:31:49.002999704 +0200
@@ -257,47 +257,6 @@
         }
 
 //
-// Something received by the control socket?
-//
-
-        if (items[0].revents & ZMQ_POLLIN)
-        {
-//cout << "For the control socket" << endl;
-            control_sock->recv(&received_ctrl);
-
-            string ret_str;
-            bool ret = false;
-
-            try
-            {
-                ret = process_ctrl(received_ctrl,items,nb_poll_item);
-                ret_str = "OK";
-            }
-            catch (zmq::error_t &e)
-            {
-                ret_str = e.what();
-            }
-            catch (Tango::DevFailed &e)
-            {
-                ret_str = e.errors[0].desc;
-            }
-
-            zmq::message_t reply(ret_str.size());
-            ::memcpy((void *)reply.data(),ret_str.data(),ret_str.size());
-            control_sock->send(reply);
-
-            if (ret == true)
-            {
-                delete heartbeat_sub_sock;
-                delete control_sock;
-                delete [] items;
-
-                break;
-            }
-            items[0].revents = 0;
-        }
-
-//
 // Something received by the event socket (TCP transport)?
 //
 
@@ -349,6 +308,47 @@
         }
 
 //
+// Something received by the control socket?
+//
+
+        if (items[0].revents & ZMQ_POLLIN)
+        {
+//cout << "For the control socket" << endl;
+            control_sock->recv(&received_ctrl);
+
+            string ret_str;
+            bool ret = false;
+
+            try
+            {
+                ret = process_ctrl(received_ctrl,items,nb_poll_item);
+                ret_str = "OK";
+            }
+            catch (zmq::error_t &e)
+            {
+                ret_str = e.what();
+            }
+            catch (Tango::DevFailed &e)
+            {
+                ret_str = e.errors[0].desc;
+            }
+
+            zmq::message_t reply(ret_str.size());
+            ::memcpy((void *)reply.data(),ret_str.data(),ret_str.size());
+            control_sock->send(reply);
+
+            if (ret == true)
+            {
+                delete heartbeat_sub_sock;
+                delete control_sock;
+                delete [] items;
+
+                break;
+            }
+            items[0].revents = 0;
+        }
+
+//
 // Something received by the event socket (mcast transport)?
 // What is stored in the zmq::pollitem_t structure is the real C
 // zmq socket, not the C++ zmq::socket_t class instance
@@ -2172,12 +2172,6 @@
                         EventQueue *ev_queue;
                         ev_queue = esspos->ev_queue;
 
-                        if (cb_ctr == cb_nb)
-                        {
-                            map_lock = false;
-                            map_modification_lock.readerOut();
-                        }
-
                         if ((ev_attr_conf == false) && (ev_attr_ready == false))
                         {
                             EventData *event_data;
@@ -2348,21 +2342,11 @@
                             }
                         }
                     }
-                    else // id < 0
-                    {
-                        if (cb_ctr == cb_nb)
-                        {
-                            map_lock = false;
-                            map_modification_lock.readerOut();
-                        }
-
-                        if ((ev_attr_conf == false) && (ev_attr_ready == false))
-                            delete dev_attr;
-                        else if (ev_attr_ready == false)
-                            delete attr_info_ex;
-                    }
                 } // End of for
 
+				map_lock = false;
+				map_modification_lock.readerOut();
+
                 delete missed_event_data;
                 delete missed_conf_event_data;
                 delete missed_ready_event_data;
@@ -2706,6 +2690,8 @@
             buffer[length] = ZMQ_DELAY_EVENT;
             length++;
 
+			eve_con->subscription_mutex.lock();
+
 //
 // Send command to main ZMQ thread
 //
@@ -2718,6 +2704,8 @@
         }
         catch (zmq::error_t &e)
         {
+			eve_con->subscription_mutex.unlock();
+
             TangoSys_OMemStream o;
 
             o << "Failed to delay event!\n";
@@ -2735,6 +2723,8 @@
 
         if (reply.size() != 2)
         {
+			eve_con->subscription_mutex.unlock();
+
             char err_mess[512];
             ::memcpy(err_mess,reply.data(),reply.size());
             err_mess[reply.size()] = '\0';
@@ -2791,9 +2781,12 @@
 
             sender.recv(&reply);
             released = true;
+			eve_con->subscription_mutex.unlock();
         }
         catch (zmq::error_t &e)
         {
+			eve_con->subscription_mutex.unlock();
+
             TangoSys_OMemStream o;
 
             o << "Failed to delay event!\n";
