Add multi-core concurrent packet processing
This commit is contained in:
parent
ac6d532651
commit
683d332abc
12 changed files with 400 additions and 190 deletions
|
@ -306,6 +306,7 @@ static Mutex globalTapCreateLock;
|
|||
|
||||
MacKextEthernetTap::MacKextEthernetTap(
|
||||
const char *homePath,
|
||||
unsigned int concurrency,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
unsigned int metric,
|
||||
|
@ -317,6 +318,7 @@ MacKextEthernetTap::MacKextEthernetTap(
|
|||
_arg(arg),
|
||||
_nwid(nwid),
|
||||
_homePath(homePath),
|
||||
_concurrency(concurrency),
|
||||
_mtu(mtu),
|
||||
_metric(metric),
|
||||
_fd(0),
|
||||
|
@ -447,7 +449,9 @@ MacKextEthernetTap::~MacKextEthernetTap()
|
|||
|
||||
::write(_shutdownSignalPipe[1],"\0",1); // causes thread to exit
|
||||
Thread::join(_thread);
|
||||
|
||||
for (std::thread &t : _rxThreads) {
|
||||
t.join();
|
||||
}
|
||||
::close(_fd);
|
||||
::close(_shutdownSignalPipe[0]);
|
||||
::close(_shutdownSignalPipe[1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue