Class DpdkMasterThread

Class Documentation

class switchml::DpdkMasterThread

A class that represents a single dpdk master thread.

A single instance is created of this thread. The thread is responsible for creating, starting, and managing all of the dpdk worker threads.

See

DpdkWorkerThread

Public Functions

DpdkMasterThread(Context &context, DpdkBackend &backend, Config &config)

Initialize all members.

Parameters
  • context[in] a reference to the switchml context.

  • backend[in] a reference to the created dpdk backend.

  • config[in] a reference to the context configuration.

~DpdkMasterThread()

Deletes the reference to the system thread.

DpdkMasterThread(DpdkMasterThread const&) = default
void operator=(DpdkMasterThread const&) = delete
DpdkMasterThread(DpdkMasterThread&&) = default
DpdkMasterThread &operator=(DpdkMasterThread&&) = default
void operator()()

This is the point of entry function for the thread.

The function starts by initializing EAL then starting worker threads. Then the master thread itself becomes a worker thread. Finally, when the master thread finishes its worker thread function it waits for other threads and cleans up before exiting.

void Start()

Start the thread.

void Join()

Wait for the thread to exit and delete its system reference.