1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:07:34 +00:00
serenity/Libraries/LibC
Andreas Kling 50677bf806 Kernel: Refactor scheduler to use dynamic thread priorities
Threads now have numeric priorities with a base priority in the 1-99
range.

Whenever a runnable thread is *not* scheduled, its effective priority
is incremented by 1. This is tracked in Thread::m_extra_priority.
The effective priority of a thread is m_priority + m_extra_priority.

When a runnable thread *is* scheduled, its m_extra_priority is reset to
zero and the effective priority returns to base.

This means that lower-priority threads will always eventually get
scheduled to run, once its effective priority becomes high enough to
exceed the base priority of threads "above" it.

The previous values for ThreadPriority (Low, Normal and High) are now
replaced as follows:

    Low -> 10
    Normal -> 30
    High -> 50

In other words, it will take 20 ticks for a "Low" priority thread to
get to "Normal" effective priority, and another 20 to reach "High".

This is not perfect, and I've used some quite naive data structures,
but I think the mechanism will allow us to build various new and
interesting optimizations, and we can figure out better data structures
later on. :^)
2019-12-30 18:46:17 +01:00
..
arpa LibC: fix arpa/inet.h guards 2019-11-16 16:27:48 +01:00
bits LibC: Minor changes to make nasm work 2019-11-09 20:52:34 +01:00
net Kernel: Add SIOCGIFHWADDR ioctl to get the MAC address of an adapter 2019-10-02 18:20:11 +02:00
netinet Libc: make library internal includes come from private include namespace 2019-10-11 12:17:05 +02:00
sys LibC+ping: Let's use the traditional timersub() et al prototypes 2019-12-27 23:07:28 +01:00
alloca.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
assert.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
assert.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
crt0.cpp LibC: Prevent assertions in malloc/free at exit time 2019-12-22 10:47:39 +01:00
crti.S Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
crtn.S Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
ctype.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
ctype.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
dirent.cpp LibC: Add readdir_r for re-entrant directory reading (#648) 2019-10-12 22:35:23 +02:00
dirent.h LibC: Added some missing directory type constants 2019-11-16 12:50:50 +01:00
dlfcn.cpp LibC: Some build fixes for strange platforms 2019-09-29 21:02:13 +02:00
dlfcn.h LibC: Misc additions 2019-10-03 08:18:05 +02:00
endian.h LibC: Oopsie, add the missing semicolons to __bswap32() and __bswap64() 2019-11-17 15:37:46 +01:00
errno.h LibC: sys_errlist should be const char* const 2019-10-17 09:18:01 +02:00
errno_numbers.h LibC: Add some missing errno codes 2019-09-12 18:26:19 +02:00
fcntl.cpp LibC: Move the creat() and open() families to <fcntl.h> 2019-11-16 17:29:09 +01:00
fcntl.h LibC: Add O_ACCMODE to fcntl.h 2019-11-18 08:55:45 +01:00
fd_set.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
float.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
getopt.cpp LibC: Ensure getopt error messages end with a newline 2019-09-17 21:56:42 +02:00
getopt.h LibC: Borrow a slightly more functional getopt() 2019-09-06 20:03:16 +02:00
grp.cpp AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
grp.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
iconv.h LibC: iconv.h needs stddef.h for size_t 2019-11-10 13:07:51 +01:00
inttypes.h LibC: Add PRIXPTR definition to inttypes.h 2019-12-09 16:33:14 +01:00
ioctl.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
libgen.cpp LibC: Implement dirname() and basename() 2019-10-03 08:23:54 +02:00
libgen.h LibC: Implement dirname() and basename() 2019-10-03 08:23:54 +02:00
limits.h Kernel+LibPthread: pthread_create handles pthread_attr_t 2019-11-18 09:04:32 +01:00
locale.cpp LibC: Added additional fields to lconv struct 2019-11-16 12:50:50 +01:00
locale.h LibC: Added additional fields to lconv struct 2019-11-16 12:50:50 +01:00
Makefile Build: wrap make invocations with flock(1) 2019-12-28 21:09:33 +01:00
malloc.cpp LibC: Prevent assertions in malloc/free at exit time 2019-12-22 10:47:39 +01:00
mallocdefs.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
memory.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
mman.cpp Kernel: Start implementing purgeable memory support 2019-12-09 19:12:38 +01:00
mman.h Kernel: Add MADV_GET_VOLATILE for checking the volatile flag 2019-12-18 20:48:24 +01:00
mntent.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
mntent.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
netdb.cpp AK: Use size_t for the length of strings 2019-12-09 17:51:21 +01:00
netdb.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
poll.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
poll.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
pwd.cpp AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
pwd.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
qsort.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
scanf.cpp LibC: Some build fixes for strange platforms 2019-09-29 21:02:13 +02:00
sched.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
sched.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
serenity.cpp Kernel+LibPthread+LibC: Add a naive futex and use it for pthread_cond_t 2019-12-25 23:54:06 +01:00
serenity.h Kernel: Refactor scheduler to use dynamic thread priorities 2019-12-30 18:46:17 +01:00
setjmp.h LibC: jmp_buf and sigjmp_buf should be distinct types 2019-11-17 21:01:26 +01:00
setjmp.S Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
SharedBuffer.cpp WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
SharedBuffer.h WindowServer+LibGUI: Implement basic color theming 2019-12-23 20:33:01 +01:00
signal.cpp Kernel+LibC: A lot of the signal handling code was off-by-one. 2019-08-01 11:03:48 +02:00
signal.h LibC: Added missing signal flags 2019-11-16 12:50:50 +01:00
signal_numbers.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
stat.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
stdarg.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
stdbool.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
stddef.h LibC: Tolerate stddef.h being included from the kernel 2019-11-29 14:53:35 +01:00
stdint.h Libc: make library internal includes come from private include namespace 2019-10-11 12:17:05 +02:00
stdio.cpp LibC: implement fgetpos and fsetpos 2019-12-27 23:09:08 +01:00
stdio.h LibC: implement fgetpos and fsetpos 2019-12-27 23:09:08 +01:00
stdlib.cpp LibC: Oops x2, we can't use "bool" in stdlib.h either 2019-12-26 10:30:34 +01:00
stdlib.h LibC: Oops x2, we can't use "bool" in stdlib.h either 2019-12-26 10:30:34 +01:00
string.cpp LibC: Remove some functions we had two of 2019-12-27 16:55:10 +01:00
string.h LibC: Add strtok_r() and make strtok() a wrapper around it 2019-11-10 21:19:08 +01:00
strings.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
strings.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
syslog.cpp LibC: syslog and lots of compat stuff for it 2019-10-15 09:52:55 +02:00
syslog.h LibC: syslog and lots of compat stuff for it 2019-10-15 09:52:55 +02:00
termcap.cpp AK: Rename <AK/AKString.h> to <AK/String.h> 2019-09-06 15:36:54 +02:00
termcap.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
termios.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
termios.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
time.cpp Kernel+LibC: Publish a "kernel info page" and use it for gettimeofday() 2019-12-15 21:29:26 +01:00
time.h LibC, LibM: Add functions needed to compile python3 2019-11-11 22:04:16 +01:00
times.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
ulimit.cpp LibC: Some build fixes for strange platforms 2019-09-29 21:02:13 +02:00
ulimit.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
unistd.cpp LibC: Remove some functions we had two of 2019-12-27 16:55:10 +01:00
unistd.h LibC: Added _PC_VDISABLE option to fpathconf() 2019-12-01 11:52:17 +01:00
utime.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
utime.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
utmp.h Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
utsname.cpp Libraries: Create top level directory for libraries. 2019-07-04 16:16:50 +02:00
wchar.cpp LibC, LibM: Add functions needed to compile python3 2019-11-11 22:04:16 +01:00
wchar.h LibC, LibM: Add functions needed to compile python3 2019-11-11 22:04:16 +01:00