| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
The only thing using this was the transport lookups, but as
those transports are now fully initialized in nng_init, we
no longer need to lock that at all.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This should help Linux platforms scale even further with NNG.
Port events and *maybe* poll are the last to do. Probably select
will remain left in the cold, because honestly select based systems
are already performance constrained.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This allows greatly increased scalability for kqueue based systems
with lots of cores (more likely FreeBSD than Darwin, as most macs
only have a smattering of cores), but even for macs we can engage
a few cores for system calls giving improvements.
The implementation here is pretty simple -- each file descriptor
gets assigned to its own kqueue by taking the numeric value of the
file descriptor modulo the number of kqueues we have opened.
The same approach will be adopted for epoll and Solaris/illumos port events.
|
| |
|
|
|
|
|
| |
This involved test-specific hacks, since connect() for UNIX domain
sockets always completes synchronously one way or the other, even though
it is documented that it might not. This found a bug, with an uninitialized
poll FD as well!
|
| |
|
|
|
| |
This was observed only in the select poller, but the behavior of having
the same file descriptor registered in the poller more than once is undefined.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This introduces a new option "NNG_OPT_LISTEN_FD", understood by TCP, TLS,
and (on POSIX systems) IPC. This option is used to pass a file descriptor
or handle (Windows) that is already listening (ready for ACCEPT to be called).
For TCP and TLS, the socket must be of type AF_INET or AF_INET6, and for IPC
it must be of type AF_UNIX.
|
| |
|
|
|
| |
This will be slower, as each vector element has to be sent in a single
system call, but for platforms that lack sendmsg it will at least work.
|
| |
|
|
|
| |
This includes checks to determine if those functions are present,
and a test case to verify that scatter gather with UDP works.
|
| |
|
|
|
|
| |
While here, remove some code paths that do not occur by definition.
(For example, if the resolver succeeds, we will definitely have a
valid set of addresses, but if it fails, we will definitely not.)
|
| |
|
|
|
|
| |
This avoids the need to perform multiple allocations for dialing,
eliminating additional potential failures. Cancellation is also
made simpler and more perfectly robust.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This avoids the need for a lock during listener or dialer initialization,
and it avoids the need to carry these pointers on those objects.
It also eliminates a potential failure case "post startup".
|
| |
|
|
|
|
|
|
|
|
| |
The endpoints both use a nesting level for some common code and some
platform dependent code. But the common code isn't that much and we
have similar patterns for e.g. IPC.
This avoids a layer of indirection in the structs, and extra allocations.
The payoff will be even larger for the dialers, but that is next.
(Dialers are more complicated because of DNS.)
|
| |
|
|
|
|
| |
This also moves the close of the UDP socket later, to avoid a
potential use after free while the aio's are still in-flight.
Unfortunately we cannot unbind cleanly without a hard close.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This will replace nni_aio_schedule, and it includes finishing the
task if needed. It does so without dropping the lock and so is
more efficient and race free.
This includes some conversion of some subsystems to it.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is done for kqueue and poll. Others coming soon.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This triggered an error on FreeBSD because apparently FreeBSD will
return a different value when seeing an AF_UNIX socket with UDP.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
The dialer aio needs to be set before starting the dial operation,
as the operation may complete right away.
|
| |
|
|
|
|
|
| |
This change moves the posix pollers to inline the PFD and makes
the callbacks constant, so that we can dispense with tests, failures,
and locks. It is anticipated that this will reduce lock based
pressure on the bus and increase performance modestly.
|
| |
|
|
|
|
|
|
|
|
|
| |
We preallocate the arrays used for pollfds, based on what the
system can tolerate (tunable with NNG_MAX_OPEN), and we change
the code for inserting and removing pollfds from the list so
that it can run without acquiring the locks during the main loop,
only when adding or removing files.
The poll() implementation is very nearly lock free in the hot
code path, and soon will be.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The poller selection in the previous poller changes for select were
not quite functional. Also, while testing poll() based poller, there
were problems where it simply did not work correctly, so this addresses
those, and it seems to work now.
The pfd structures are exposed as we intend to allow inlining them
to eliminate the separate allocation and potential for failure during
initialization. We also want to have plans afoot to eliminate a
lot of the extra locking done done on each I/O iteration, and this
is setting the foundation for that.
|