Commit Graph

31 Commits (6c2ae469be6a79b1405ca793f15c74c0fba0e3a8)

Author SHA1 Message Date
Victor Julien d8cb821875 locks: clean up locks declarations
Split threads.h into several files, where each of these files defines
all lock types and macro's.

threads.h defines the normal case
threads-debug.h defines the debug variants
threads-profile.h defines the lock profiling variants

Finally, threads-arch-tile.h moves the Tilera specifics out
12 years ago
Ken Steele 592d48aab7 Use Spin locks on Tile
On Tile, replace pthread_mutex_locks with queued spin locks (ticket
locks) for dataplane processing code. This is safe when running on
dataplane cores with one thread per core. The condition variables are
no-ops when the thread is spinning anyway.

For control plane threads, unix-manager, stats-logs, thread startup,
use pthread_mutex_locks. For these locks replaced SCMutex with SCCtrlMutex
and SCCond with SCCtrlCond.
12 years ago
Ken Steele 5532af4621 Create SCMUTEX_INITIALIZER to abstract out PTHREAD_MUTEX_INITIALIZER
This allows replacing pthread mutexes with other types of mutex.
12 years ago
Victor Julien 389c48f222 Fix detection of spin locks supported. Clean up how we handle falling back to mutex if spinlocks aren't supported. 13 years ago
Eric Leblond 4d2305c0a8 freebsd: fix warning 13 years ago
Nikolay Denev 50aba06530 Fix SCSetThreadName() macros in threads.h Add FreeBSD thread naming implementation. 14 years ago
Victor Julien d908e707d7 profiling: add per lock location profiling
Add profiling per lock location in the code. Accounts how often a
lock is requested, how often it was contended, the max number of
ticks spent waiting for it, avg number of ticks waiting for it and
the total ticks for that location.

Added a new configure flag --enable-profiling-locks to enable this
feature.
14 years ago
Victor Julien 979edf0b97 Add way to profile mutex/spin locks per thread module. 14 years ago
Victor Julien 7066a79c10 Register HTTP logger at registration, not thread init. 14 years ago
Victor Julien 1be65e7b68 Fixes for building in Cygwin. 14 years ago
Victor Julien 95387b2297 Include <windows.h> to get access to THREAD_PRIORITY_* defines. 15 years ago
Eric Leblond 4e9231266a Compilation fix for OpenBSD and win32.
This patch fixes compilation on OpenBSD platform. It is running
fine on a pcap file. The patch should also fix compilation on
WIN32 platform but this is not tested.
15 years ago
Eric Leblond 56c95bf622 Convert thread PRIO to a enum
This patch converts thread prio value to an enum. This
can add some useful check by gcc in switch.

Signed-off-by: Eric Leblond <eric@regit.org>
15 years ago
Pablo Rincon 14a12f5fb7 Adding atomic bitwise operations api and rwlocks support 15 years ago
Victor Julien dce323b1f4 Fix SCondWait -> SCCondWait typo. 16 years ago
William Metcalf 7d63fbdaea small CentOS 4 workarounds 16 years ago
William Metcalf ce01927515 Import of GPLv2 Header 050410 16 years ago
Victor Julien eeb98c6900 Move SCSetThreadName to proper functions. 16 years ago
Gerardo Iglesias Galvan 9f35a24a1f Set threads name. Fix bug #83 16 years ago
Victor Julien ae2698c9cc Properly cleanup used mutexes and condition vars in the flow subsys. 16 years ago
Jan Jezek c1cbdf6ae9 Win32 build fixed. 16 years ago
Pablo Rincon 7719216575 Setting thread priorities with nice 16 years ago
Victor Julien 16b6f536a0 Fixup Linux compilation after applying win32 patches. 16 years ago
Jan Jezek fe6a72befc Code is now compilable on the Win32 platform 16 years ago
Pablo Rincon b482471a7d Adding auto runmodes based on available core/cpu's. Setting thread priorities 16 years ago
Nick Rogness 2b7b78f1bf Intial IPFW support FreeBSD and OSX 16 years ago
Pablo Rincon e26833be3f Changing mutex/spinlocks/conditions naming types 16 years ago
Pablo Rincon 769022f4be Adding support for Mac OS X, FreeBSD, centrailizing mutex/spins/conditions in a macro API, and some unittests 16 years ago
Victor Julien 1858be7a2f Lock threadvars flags using spinlocks. 16 years ago
Victor Julien 8cda70668c Tunnel fixes. 17 years ago
Victor Julien bab4b62376 Initial add of the files. 17 years ago