summaryrefslogtreecommitdiffstats
path: root/src/server/threadpool.c
Commit message (Collapse)AuthorAgeFilesLines
* [SERVER] Make signal handling more POSIXSimon Rettberg2019-08-281-6/+22
| | | | | | | | | | | | | | | According to POSIX, a signal sent to a PID can be delivered to an arbitrary thread of that process that hasn't the signal blocked. This seens to never happen on Linux, but would mess things up since the code expected the main signal handler to only be executed by the main thread. This should now be fixed by examining the destination PID of the signal as well as the ID of the thread currently running the signal handler. If we notice the signal wasn't sent by our own PID and the handler is not currently run by the main thread, we re-send the signal to the main thread. Otherwise, if the signal was sent by our own PID but the handler is not run in the main thread, do nothing. This way we can use pthread_kill() to wake up threads that might be stuck in a blocking syscall when it's time to shut down.
* [SERVER] Lock free thread poolSimon Rettberg2019-08-161-53/+57
|
* [SERVER] Add sanity check to threadpool_run for NULL routineSimon Rettberg2019-08-051-0/+4
|
* [SERVER] Switch threadpool back to spinlock, add idle thread counterSimon Rettberg2019-08-051-22/+23
|
* [SERVER] Turn all spinlocks into mutexesSimon Rettberg2019-07-261-10/+10
| | | | | | | | Just assume sane platforms offer smart mutexes that have a fast-path with spinlocks internally for locks that have little to no congestion. In all other cases, mutexes should perform better anyways.
* cleanup commitsSebastian2016-02-111-5/+1Star
|
* [SHARED] signal.h -> fdsignal.hSimon Rettberg2016-02-101-1/+1
|
* First steps in make signals more abstract from the underlying mechanism; ↵Simon Rettberg2016-02-051-9/+9
| | | | | | | | | | replace epoll with poll. We now don't assume that a signal equals a single fd (eventfd on Linux). The next step would be to create a version of signal.c that uses a pipe internally, so it can be used on other platforms, like *BSD. This is also the reason epoll was replaced with poll in uplink.c
* [SERVER] Fix a lot of (mostly harmless) data racesSimon Rettberg2016-01-111-2/+3
|
* [FUSE] Start refactoring so we can handle multithread fuseSimon Rettberg2015-11-211-1/+1
|
* [SERVER] Overhauled loggingSimon Rettberg2015-02-221-5/+5
| | | | | | - Added message type parameter - Log to file and stdout, no more logging in memory - Added options to server.conf to filter which messages show up where
* Get rid of unneccessary volatileSimon Rettberg2015-02-221-1/+1
| | | | Some minor debugging code, mostly commented out
* [SERVER] Fix automatic proxying to use supplied connection; fix race ↵Simon Rettberg2015-01-271-2/+0Star
| | | | condition in uplink_init
* [SERVER] Support blocking signals, saves a syscall in threadpoolSimon Rettberg2015-01-091-2/+2
|
* [SERVER] Big code cleanup, refactoring, minor bugfixingSimon Rettberg2015-01-061-6/+29
|
* [SERVER] Use a thread pool for client connectionsSimon Rettberg2015-01-051-0/+108