aboutsummaryrefslogtreecommitdiff
path: root/src/platform
Commit message (Collapse)AuthorAge
* posix: move tcpdialer definition out of shared headerGarrett D'Amore2025-01-05
|
* platform: remove reader/writer locksGarrett D'Amore2025-01-05
| | | | | | 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.
* platform: eliminate NNI_CV_INITIALIZER altogetherGarrett D'Amore2025-01-05
|
* pthreads: avoid double indirection for cv mutexGarrett D'Amore2025-01-05
|
* Liberally apply some UWYI (use what you include) to header filesGarrett D'Amore2025-01-05
|
* fixes #2061 Move IPC parameters from uint64 to intGarrett D'Amore2025-01-03
|
* poll poller: support concurrency for pollers using poll()Garrett D'Amore2024-12-30
|
* poller: port events scalability (illumos/Solaris)Garrett D'Amore2024-12-30
|
* fixes #530 POSIX pollqs should scale horizontally (epoll)Garrett D'Amore2024-12-30
| | | | | | | | 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.
* kqueue: support concurrent pollersGarrett D'Amore2024-12-30
| | | | | | | | | | | | | 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.
* ipc test: add a case for IPC that never connectsGarrett D'Amore2024-12-30
| | | | | | | 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!
* ipc/tcp stream tests: use dup() to avoid confusion and hang in teardownGarrett D'Amore2024-12-30
| | | | | 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.
* bump test timeouts for CI/CDGarrett D'Amore2024-12-30
|
* fixup! fixes #863 socket activation: for TCP and IPC (POSIX only)Garrett D'Amore2024-12-30
|
* socket activation: test fixes (improve coverage, etc.)Garrett D'Amore2024-12-30
|
* fixes #863 socket activation: for TCP and IPC (POSIX only)Garrett D'Amore2024-12-30
| | | | | | | | | 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.
* posix: fall back to send if sendmsg is unavailable for ipc and tcpGarrett D'Amore2024-12-29
| | | | | 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.
* udp: use a bounce buffer if we lack sendmsg or recvmsgGarrett D'Amore2024-12-29
| | | | | This includes checks to determine if those functions are present, and a test case to verify that scatter gather with UDP works.
* resolver: add some additional test coverageGarrett D'Amore2024-12-29
| | | | | | 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.)
* resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
| | | | | | This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust.
* windows tcp: fix compilation warningGarrett D'Amore2024-12-28
|
* tcp stream: add test for ESTATE getting port on unbound listenerGarrett D'Amore2024-12-28
|
* windows tcp: Lookup extended TCP function pointers at startupGarrett D'Amore2024-12-28
| | | | | | 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".
* tcp: flatten the listener implementationGarrett D'Amore2024-12-28
| | | | | | | | | | 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.)
* udp: use nni_aio_startGarrett D'Amore2024-12-26
| | | | | | 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.
* ipc: use nni_aio_startGarrett D'Amore2024-12-26
|
* resolver: use nni_aio_startGarrett D'Amore2024-12-26
|
* tcp: use nni_aio_startGarrett D'Amore2024-12-26
|
* sockfd: convert to use nni_aio_startGarrett D'Amore2024-12-26
|
* posix resolver: use nni_aio_deferGarrett D'Amore2024-12-24
|
* aio: introduce nni_aio_deferGarrett D'Amore2024-12-22
| | | | | | | | 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.
* posix tcp: use common refcnt implementationGarrett D'Amore2024-12-22
|
* port events poller (illumos/Solaris): use atomic events maskGarrett D'Amore2024-12-22
|
* epoll: use atomic event maskGarrett D'Amore2024-12-22
|
* pollers: use atomic bit masking operations to eliminate lockssGarrett D'Amore2024-12-22
| | | | This is done for kqueue and poll. Others coming soon.
* ipc dialer: use common refcnt logicGarrett D'Amore2024-12-22
|
* poll: sign extension bug + incorrect use leads to tiny max files on macOSGarrett D'Amore2024-12-22
|
* posix IPv6: BSD platforms us netinet6/in6.hGarrett D'Amore2024-12-21
|
* posix udp: AF_INET6 fixupGarrett D'Amore2024-12-21
|
* posix udp: More explicit checks for bogus address familyGarrett D'Amore2024-12-21
| | | | | This triggered an error on FreeBSD because apparently FreeBSD will return a different value when seeing an AF_UNIX socket with UDP.
* files test: check to skip permissions before testingGarrett D'Amore2024-12-21
|
* posix udp: stop the PFD explicitly before finalizingGarrett D'Amore2024-12-21
|
* poll: fix poll based pollerGarrett D'Amore2024-12-21
|
* epoll: fixes for races and early wakeupsGarrett D'Amore2024-12-21
|
* posix: fix for IPC and TCP dialingGarrett D'Amore2024-12-21
| | | | | The dialer aio needs to be set before starting the dial operation, as the operation may complete right away.
* posix pollers: inline the pfd and make callbacks constantGarrett D'Amore2024-12-20
| | | | | | | 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.
* poll: performance improvements, simplificationsGarrett D'Amore2024-12-19
| | | | | | | | | | | 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.
* posix pollers: expose pfd structures (for sizes) and fix poller selectionGarrett D'Amore2024-12-19
| | | | | | | | | | | | | 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.
* kqueue: eliminate extra locking on each I/OGarrett D'Amore2024-12-18
| | | | | This should reduce lock pressure during I/O for FreeBSD and macOS, and should provide a small performance benefit.
* POSIX poller: add support for select, and for choosing the pollerGarrett D'Amore2024-12-17
| | | | | Some platforms or configurations may not have more modern options like kqueue or epoll, or may be constrained by policy.