diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 5918a01..1a9bb41 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -34,6 +34,20 @@
 
 #define VPPCOM_DEBUG vcm->debug
 
+extern __thread uword __vcl_worker_index;
+
+static inline void
+vcl_set_worker_index (uword wrk_index)
+{
+  __vcl_worker_index = wrk_index;
+}
+
+static inline uword
+vcl_get_worker_index (void)
+{
+  return __vcl_worker_index;
+}
+
 /*
  * VPPCOM Private definitions and functions.
  */
@@ -43,6 +57,9 @@
   STATE_APP_CONN_VPP,
   STATE_APP_ENABLED,
   STATE_APP_ATTACHED,
+  STATE_APP_ADDING_WORKER,
+  STATE_APP_FAILED,
+  STATE_APP_READY
 } app_state_t;
 
 typedef enum
@@ -64,9 +81,9 @@
 
 typedef struct
 {
-  u32 next_sid;
-  u32 prev_sid;
-  u32 vep_idx;
+  u32 next_sh;
+  u32 prev_sh;
+  u32 vep_sh;
   vppcom_epoll_event_t ev;
 #define VEP_DEFAULT_ET_MASK  (EPOLLIN|EPOLLOUT)
 #define VEP_UNSUPPORTED_EVENTS (EPOLLONESHOT|EPOLLEXCLUSIVE)
@@ -142,7 +159,6 @@
   int libc_epfd;
   svm_msg_q_t *our_evt_q;
   u64 options[16];
-  vce_event_handler_reg_t *poll_reg;
   vcl_session_msg_t *accept_evts_fifo;
 #if VCL_ELOG
   elog_track_t elog_track;
@@ -152,6 +168,7 @@
 typedef struct vppcom_cfg_t_
 {
   u64 heapsize;
+  u32 max_workers;
   u32 vpp_api_q_length;
   u64 segment_baseva;
   u32 segment_size;
@@ -194,20 +211,15 @@
   int mq_fd;
 } vcl_mq_evt_conn_t;
 
-typedef struct vppcom_main_t_
+typedef struct vcl_worker_
 {
-  u8 init;
-  u32 debug;
-  int main_cpu;
+  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
 
-  /* vpp input queue */
-  svm_queue_t *vl_input_queue;
-
-  /* API client handle */
-  u32 my_client_index;
   /* Session pool */
   vcl_session_t *sessions;
 
+  u32 wrk_index;
+
   /** Message queues epoll fd. Initialized only if using mqs with eventfds */
   int mqs_epfd;
 
@@ -217,39 +229,23 @@
   /** Per worker buffer for receiving mq epoll events */
   struct epoll_event *mq_events;
 
-  /* Hash table for disconnect processing */
+  /** Hash table for disconnect processing */
   uword *session_index_by_vpp_handles;
 
-  /* Select bitmaps */
+  /** Select bitmaps */
   clib_bitmap_t *rd_bitmap;
   clib_bitmap_t *wr_bitmap;
   clib_bitmap_t *ex_bitmap;
 
-  /* Our event queue */
+  /** Our event message queue */
   svm_msg_q_t *app_event_queue;
 
+  /** VPP workers event message queues */
   svm_msg_q_t **vpp_event_queues;
 
-  /* unique segment name counter */
-  u32 unique_segment_index;
-
-  /* For deadman timers */
+  /** For deadman timers */
   clib_time_t clib_time;
 
-  /* State of the connection, shared between msg RX thread and main thread */
-  volatile app_state_t app_state;
-
-  vppcom_cfg_t cfg;
-
-  /* Event thread */
-  vce_event_thread_t event_thread;
-
-  /* IO thread */
-  vppcom_session_io_thread_t session_io_thread;
-
-  /* pool of ctrl msgs */
-  vcl_session_msg_t *ctrl_evt_pool;
-
   /** Pool of cut through registrations */
   vcl_cut_through_registration_t *cut_through_registrations;
 
@@ -259,11 +255,34 @@
   /** Cut-through registration by mq address hash table */
   uword *ct_registration_by_mq;
 
+  /** Vector acting as buffer for mq messages */
   svm_msg_q_msg_t *mq_msg_vector;
+} vcl_worker_t;
+
+typedef struct vppcom_main_t_
+{
+  u8 is_init;
+  u32 debug;
+  pthread_t main_cpu;
+
+  /** VPP binary api input queue */
+  svm_queue_t *vl_input_queue;
+
+  /** API client handle */
+  u32 my_client_index;
+
+  /** State of the connection, shared between msg RX thread and main thread */
+  volatile app_state_t app_state;
+
+  /** VCL configuration */
+  vppcom_cfg_t cfg;
 
   /** Flag indicating that a new segment is being mounted */
   volatile u32 mounting_segment;
 
+  /** Workers */
+  vcl_worker_t *workers;
+
 #ifdef VCL_ELOG
   /* VPP Event-logger */
   elog_main_t elog_main;
@@ -272,6 +291,14 @@
 
   /* VNET_API_ERROR_FOO -> "Foo" hash table */
   uword *error_string_by_error_number;
+
+  /* Obsolete */
+
+  /* Event thread */
+  vce_event_thread_t event_thread;
+
+  /* IO thread */
+  vppcom_session_io_thread_t session_io_thread;
 } vppcom_main_t;
 
 extern vppcom_main_t *vcm;
@@ -279,111 +306,175 @@
 #define VCL_INVALID_SESSION_INDEX ((u32)~0)
 
 static inline vcl_session_t *
-vcl_session_alloc (void)
+vcl_session_alloc (vcl_worker_t * wrk)
 {
   vcl_session_t *s;
-  pool_get (vcm->sessions, s);
+  pool_get (wrk->sessions, s);
   memset (s, 0, sizeof (*s));
+  s->session_index = s - wrk->sessions;
   return s;
 }
 
 static inline void
-vcl_session_free (vcl_session_t * s)
+vcl_session_free (vcl_worker_t * wrk, vcl_session_t * s)
 {
-  pool_put (vcm->sessions, s);
+  pool_put (wrk->sessions, s);
 }
 
 static inline vcl_session_t *
-vcl_session_get (u32 session_index)
+vcl_session_get (vcl_worker_t * wrk, u32 session_index)
 {
-  if (pool_is_free_index (vcm->sessions, session_index))
+  if (pool_is_free_index (wrk->sessions, session_index))
     return 0;
-  return pool_elt_at_index (vcm->sessions, session_index);
+  return pool_elt_at_index (wrk->sessions, session_index);
 }
 
-static inline u32
-vcl_session_index (vcl_session_t * s)
+static inline int
+vcl_session_handle (vcl_session_t * s)
 {
-  return (s - vcm->sessions);
+  ASSERT (s->session_index < 2 << 24);
+  return (vcl_get_worker_index () << 24 | s->session_index);
+}
+
+static inline void
+vcl_session_handle_parse (u32 handle, u32 * wrk_index, u32 * session_index)
+{
+  *wrk_index = handle >> 24;
+  *session_index = handle & 0xFFFFFF;
 }
 
 static inline vcl_session_t *
-vcl_session_get_w_handle (u64 handle)
+vcl_session_get_w_handle (vcl_worker_t * wrk, u32 session_handle)
+{
+  u32 session_index, wrk_index;
+  vcl_session_handle_parse (session_handle, &wrk_index, &session_index);
+  ASSERT (wrk_index == wrk->wrk_index);
+  return vcl_session_get (wrk, session_index);
+}
+
+static inline vcl_session_t *
+vcl_session_get_w_vpp_handle (vcl_worker_t * wrk, u64 vpp_handle)
 {
   uword *p;
-  if ((p = hash_get (vcm->session_index_by_vpp_handles, handle)))
-    return vcl_session_get ((u32) p[0]);
+  if ((p = hash_get (wrk->session_index_by_vpp_handles, vpp_handle)))
+    return vcl_session_get (wrk, (u32) p[0]);
   return 0;
 }
 
 static inline u32
-vcl_session_get_index_from_handle (u64 handle)
+vcl_session_index_from_vpp_handle (vcl_worker_t * wrk, u64 vpp_handle)
 {
   uword *p;
-  if ((p = hash_get (vcm->session_index_by_vpp_handles, handle)))
+  if ((p = hash_get (wrk->session_index_by_vpp_handles, vpp_handle)))
     return p[0];
   return VCL_INVALID_SESSION_INDEX;
 }
 
+static inline void
+vcl_session_table_add_vpp_handle (vcl_worker_t * wrk, u64 handle, u32 value)
+{
+  hash_set (wrk->session_index_by_vpp_handles, handle, value);
+}
+
+static inline void
+vcl_session_table_del_vpp_handle (vcl_worker_t * wrk, u64 vpp_handle)
+{
+  hash_unset (wrk->session_index_by_vpp_handles, vpp_handle);
+}
+
+static inline uword *
+vcl_session_table_lookup_vpp_handle (vcl_worker_t * wrk, u64 handle)
+{
+  return hash_get (wrk->session_index_by_vpp_handles, handle);
+}
+
+static inline void
+vcl_session_table_add_listener (vcl_worker_t * wrk, u64 listener_handle,
+				u32 value)
+{
+  /* Session and listener handles have different formats. The latter has
+   * the thread index in the upper 32 bits while the former has the session
+   * type. Knowing that, for listeners we just flip the MSB to 1 */
+  listener_handle |= 1ULL << 63;
+  hash_set (wrk->session_index_by_vpp_handles, listener_handle, value);
+}
+
+static inline void
+vcl_session_table_del_listener (vcl_worker_t * wrk, u64 listener_handle)
+{
+  listener_handle |= 1ULL << 63;
+  hash_unset (wrk->session_index_by_vpp_handles, listener_handle);
+}
+
+static inline vcl_session_t *
+vcl_session_table_lookup_listener (vcl_worker_t * wrk, u64 listener_handle)
+{
+  uword *p;
+  u64 handle = listener_handle | (1ULL << 63);
+  vcl_session_t *session;
+
+  p = hash_get (wrk->session_index_by_vpp_handles, handle);
+  if (!p)
+    {
+      clib_warning ("VCL<%d>: couldn't find listen session: unknown vpp "
+		    "listener handle %llx", getpid (), listener_handle);
+      return 0;
+    }
+  if (pool_is_free_index (wrk->sessions, p[0]))
+    {
+      VDBG (1, "VCL<%d>: invalid listen session, sid (%u)", getpid (), p[0]);
+      return 0;
+    }
+
+  session = pool_elt_at_index (wrk->sessions, p[0]);
+  ASSERT (session->session_state & STATE_LISTEN);
+  return session;
+}
+
+const char *vppcom_session_state_str (session_state_t state);
+
 static inline u8
 vcl_session_is_ct (vcl_session_t * s)
 {
   return (s->our_evt_q != 0);
 }
 
-static inline void
-vppcom_session_table_add_listener (u64 listener_handle, u32 value)
-{
-  /* Session and listener handles have different formats. The latter has
-   * the thread index in the upper 32 bits while the former has the session
-   * type. Knowing that, for listeners we just flip the MSB to 1 */
-  listener_handle |= 1ULL << 63;
-  hash_set (vcm->session_index_by_vpp_handles, listener_handle, value);
-}
-
-static inline vcl_session_t *
-vppcom_session_table_lookup_listener (u64 listener_handle)
-{
-  uword *p;
-  u64 handle = listener_handle | (1ULL << 63);
-  vcl_session_t *session;
-
-  p = hash_get (vcm->session_index_by_vpp_handles, handle);
-  if (!p)
-    {
-      clib_warning ("VCL<%d>: couldn't find listen session: unknown vpp "
-		    "listener handle %llx", getpid (), listener_handle);
-      return 0;
-    }
-  if (pool_is_free_index (vcm->sessions, p[0]))
-    {
-      VDBG (1, "VCL<%d>: invalid listen session, sid (%u)", getpid (), p[0]);
-      return 0;
-    }
-
-  session = pool_elt_at_index (vcm->sessions, p[0]);
-  ASSERT (session->session_state & STATE_LISTEN);
-  return session;
-}
-
-const char *vppcom_session_state_str (session_state_t state);
-
 /*
  * Helpers
  */
-vcl_cut_through_registration_t *vcl_ct_registration_lock_and_alloc (void);
-void vcl_ct_registration_del (vcl_cut_through_registration_t * ctr);
-u32 vcl_ct_registration_index (vcl_cut_through_registration_t * ctr);
-void vcl_ct_registration_unlock (void);
-vcl_cut_through_registration_t *vcl_ct_registration_get (u32 ctr_index);
-vcl_cut_through_registration_t *vcl_ct_registration_lock_and_lookup (uword);
-void vcl_ct_registration_lookup_add (uword mq_addr, u32 ctr_index);
-void vcl_ct_registration_lookup_del (uword mq_addr);
-vcl_mq_evt_conn_t *vcl_mq_evt_conn_alloc (void);
-u32 vcl_mq_evt_conn_index (vcl_mq_evt_conn_t * mqc);
-vcl_mq_evt_conn_t *vcl_mq_evt_conn_get (u32 mq_conn_idx);
-int vcl_mq_epoll_add_evfd (svm_msg_q_t * mq);
-int vcl_mq_epoll_del_evfd (u32 mqc_index);
+int vcl_wait_for_app_state_change (app_state_t app_state);
+vcl_cut_through_registration_t
+  * vcl_ct_registration_lock_and_alloc (vcl_worker_t * wrk);
+void vcl_ct_registration_del (vcl_worker_t * wrk,
+			      vcl_cut_through_registration_t * ctr);
+u32 vcl_ct_registration_index (vcl_worker_t * wrk,
+			       vcl_cut_through_registration_t * ctr);
+void vcl_ct_registration_lock (vcl_worker_t * wrk);
+void vcl_ct_registration_unlock (vcl_worker_t * wrk);
+vcl_cut_through_registration_t
+  * vcl_ct_registration_lock_and_lookup (vcl_worker_t * wrk, uword mq_addr);
+void vcl_ct_registration_lookup_add (vcl_worker_t * wrk, uword mq_addr,
+				     u32 ctr_index);
+void vcl_ct_registration_lookup_del (vcl_worker_t * wrk, uword mq_addr);
+vcl_mq_evt_conn_t *vcl_mq_evt_conn_alloc (vcl_worker_t * wrk);
+u32 vcl_mq_evt_conn_index (vcl_worker_t * wrk, vcl_mq_evt_conn_t * mqc);
+vcl_mq_evt_conn_t *vcl_mq_evt_conn_get (vcl_worker_t * wrk, u32 mq_conn_idx);
+int vcl_mq_epoll_add_evfd (vcl_worker_t * wrk, svm_msg_q_t * mq);
+int vcl_mq_epoll_del_evfd (vcl_worker_t * wrk, u32 mqc_index);
+
+vcl_worker_t *vcl_worker_alloc_and_init (void);
+
+static inline vcl_worker_t *
+vcl_worker_get (u32 wrk_index)
+{
+  return pool_elt_at_index (vcm->workers, wrk_index);
+}
+
+static inline vcl_worker_t *
+vcl_worker_get_current (void)
+{
+  return vcl_worker_get (vcl_get_worker_index ());
+}
 
 /*
  * VCL Binary API
@@ -393,14 +484,13 @@
 void vppcom_send_session_enable_disable (u8 is_enable);
 void vppcom_app_send_attach (void);
 void vppcom_app_send_detach (void);
-void vppcom_send_connect_sock (vcl_session_t * session, u32 session_index);
-void vppcom_send_disconnect_session_reply (u64 vpp_handle, u32 session_index,
-					   int rv);
+void vppcom_send_connect_sock (vcl_session_t * session);
 void vppcom_send_disconnect_session (u64 vpp_handle, u32 session_index);
-void vppcom_send_bind_sock (vcl_session_t * session, u32 session_index);
+void vppcom_send_bind_sock (vcl_session_t * session);
 void vppcom_send_unbind_sock (u64 vpp_handle);
 void vppcom_api_hookup (void);
-void vppcom_send_accept_session_reply (u64 handle, u32 context, int retval);
+void vppcom_send_accept_session_reply (u64 vpp_handle, u32 context, int rv);
+void vcl_send_app_worker_add_del (u8 is_add);
 
 u32 vcl_max_nsid_len (void);
 
