---
name: "ACE_EH_Dispatch_Info"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_EH_Dispatch_Info"
---

# ACE\_EH\_Dispatch\_Info(3)

This structure contains information of the activated event handler.

## NAME

ACE\_EH\_Dispatch\_Info -

This structure contains information of the activated event handler.

## SYNOPSIS

```
#include <ace/TP_Reactor.h>
class ACE_EH_Dispatch_Info
{
  public:
    ACE_EH_Dispatch_Info (void);
    void set (
        ACE_HANDLE handle,
        ACE_Event_Handler *event_handler,
        ACE_Reactor_Mask mask,
        ACE_EH_PTMF callback
        );
    void reset (void);
    int dispatch (void) const;
    ACE_HANDLE handle_;
    ACE_Event_Handler *event_handler_;
    ACE_Reactor_Mask mask_;
    ACE_EH_PTMF callback_;
    int dispatch_;
};
```

## DESCRIPTION

TP\_Reactor (ala, Thread Pool Reactor) uses the leader-follower model to demultiplex requests among a bunch of threads. Basically, when using thread pool reactor, one will pre-spawn a \_fixed\_ number of threads.  When you issue the run\_event\_loop method, one of the thread will become the leader thread and wait for an event.  The other threads (followers) will be lined up and waiting for their turns to become the leader.  When an event occurs, the leader will pick a follower to become the leader and go on to handle the event.  The consequence of using TP\_Reactor is the amortization of the costs used to creating threads.  The context switching cost will also reduce.  More over, the total resources used by threads are bounded (because there are only so many threads.)

## PUBLIC MEMBERS

```
ACE_EH_Dispatch_Info (void);
```

```
void set (
    ACE_HANDLE handle,
    ACE_Event_Handler *event_handler,
    ACE_Reactor_Mask mask,
    ACE_EH_PTMF callback
    );
```

```
void reset (void);
```

```
int dispatch (void) const;
```

```
ACE_HANDLE handle_;
```

```
ACE_Event_Handler *event_handler_;
```

```
ACE_Reactor_Mask mask_;
```

```
ACE_EH_PTMF callback_;
```

```
int dispatch_;
```

## AUTHOR

Irfan Pyarali Nanbor Wang

## LIBRARY

ace
