Commit graph

67 commits

Author SHA1 Message Date
Robin Gareus
599d02bd2e
Amend previous commit, fix diff 2025-11-10 20:12:53 +01:00
Robin Gareus
8929147566
Another partial revert of 4998b114ea, fix mingw builds 2025-11-10 20:04:11 +01:00
Robin Gareus
4998b114ea
First batch of change of waf/MSVC specific changes from EZ4Stephen 2025-11-09 20:51:56 +01:00
Paul Davis
02aeb3895f NO-OP: newline/whitespace/brace 2025-04-24 12:07:19 -06:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Robin Gareus
8115578d4e
Add RT thread priority debugging 2024-10-14 21:49:56 +02:00
Robin Gareus
0aff098541
Fix IO Thread priority
This adds `pbd_pthread_priority` indirection to correctly get
the absolute thread priority.

and for consistency a 4 letter enum is used.
2024-10-11 10:06:49 +02:00
John Emmas
07c79ce92c Small changes to make pthread_utils.cc buildable again with MSVC 2024-10-01 20:28:16 +01:00
Robin Gareus
dab22a7c70
Explicitly set Windows Process Scheduling Class 2024-09-30 19:57:53 +02:00
Robin Gareus
ed437afda7
Fix thread priorities for Windows builds 2024-09-30 19:07:53 +02:00
Robin Gareus
1d921dec0b
Debug thread sched_priority 2024-09-28 14:47:52 +02:00
Robin Gareus
dd4a1a6d73
Set thread priority relative to backend
This also removed direct calls to backend real_time_priority
for good measure.
2024-09-28 04:15:39 +02:00
Robin Gareus
dcd79f3135
Debug Backend thread creation 2024-09-28 03:16:50 +02:00
Robin Gareus
aeb4f925c6
PBD pthreads: allow unlimited stacksize 2024-09-28 03:16:45 +02:00
Robin Gareus
e8445d13ec
Require thread name to be passed to PBD::Thread and store thread 2024-09-28 03:16:30 +02:00
Robin Gareus
c4fdd5356c
Enable debugging for stored threads 2024-09-28 03:14:16 +02:00
Robin Gareus
5b9e4fff63
Parallelize Disk I/O and RegionFx processing 2024-04-30 03:46:39 +02:00
Robin Gareus
2d5ac04ae1
pthread_setname_np is available with GNU/mingw 2023-06-17 23:49:47 +02:00
Robin Gareus
4f3b8a9776
Allow to override default stack limit for background processes 2022-11-13 03:01:57 +01:00
Robin Gareus
87ee609339
Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
Robin Gareus
fd5d290217
Fix mach thread time constraints on M1
or any system where timebase is not 1 tick per ns.
2022-06-03 05:27:42 +02:00
Robin Gareus
c2cff575b7
Add debug info to track down M1 time-constraint issue 2022-06-03 03:52:43 +02:00
Robin Gareus
e515e73db6
Implement a replacement for Glib::Threads::Thread
This is mainly because Glib::Threads (g_system_thread_new)
uses pthread on Un*x, but on Windows relies on GThreadWin32
(HANDLE)_beginthreadex

This later causes issues e.g. in BaseUI::run()

```
unhandled exception (type Glib::Error) in signal handler:
domain: g_thread_error
code  : 0
what  : Error setting new thread priority: The parameter is incorrect.
```
2022-03-01 01:33:08 +01:00
Robin Gareus
a74b4e8ef0
No more wine 2021-07-03 19:07:25 +02:00
Robin Gareus
7ce43739e8
Tweak sched priorities use given and 4 levels below. 2021-06-10 14:38:45 +02:00
Robin Gareus
89a0040f1b
Allow to override rt priority for internal backends 2021-06-10 03:17:53 +02:00
Robin Gareus
28619fe71b
Fix window process thread priorities
While POSIX defines a single contiguous range of numbers that
determine a thread's priority. Win32 defines priority classes
and priority levels relative to these classes.

pthread maps those to -15 .. +15 with the top six ones
corresponding to REALTIME_PRIORITY_CLASS and max being
THREAD_PRIORITY_TIME_CRITICAL

Note that the PA backend can USE_MMCSS_THREAD_PRIORITIES
and PBD::MMCSS::set_thread_characteristics() directly for
the I/O threads.
2021-05-14 01:59:20 +02:00
Robin Gareus
438b1e5eab
Cont'd work to improve macOS rt priority 2021-05-02 20:24:10 +02:00
Robin Gareus
53e710bc5f
macOS: apply time scaling for rt constraints 2021-05-01 02:49:06 +02:00
Matthias von Faber
e3dcd1f5d7
Only try using __pthread_get_minstack on glibc
This is a glibc-only extension, so don't bother on other platforms.
Also, according to POSIX, PTHREAD_STACK_MIN is defined in limits.h, so
include climits just to be safe.
2020-06-09 17:39:24 +02:00
Robin Gareus
c7bce4b685
NO-OP: whitespace 2020-06-07 18:25:18 +02:00
Robin Gareus
21b8885fe9
Remove debug output (also fix some builds, missing stdio.h) 2020-06-07 18:18:58 +02:00
Robin Gareus
27e45c585f
Fix another stupid typo 2020-06-06 23:03:21 +02:00
Robin Gareus
e0548fa798
Offset stack-size by current TLS #8200
Some libraries use thread locals and hence increase the min
requirement.

This is seen on void-linux for example:

> linking a minimal program against cairo gives a
> __static_tls_size of 43008 bytes.
> Doing the same on Ubuntu focal and Debian bullseye,
> __static_tls_size is only 4608.
2020-06-06 19:04:26 +02:00
Robin Gareus
515ffbdfe2
Add API to create threads with given stacksize 2020-06-06 18:32:09 +02:00
Robin Gareus
3d166c7789
Consolidate stack-size and priority of rt-threads 2020-04-23 01:28:58 +02:00
Robin Gareus
d6a38d5450
Set public thread name
This allows to identify Ardour thread using standard unix
tools (ps, htop) and inspect priorities, CPU load etc.
2020-03-29 13:55:20 +02:00
Robin Gareus
4f8777e968
Tweak mach thread priority debug msg 2020-02-24 05:29:56 +01:00
Robin Gareus
e737a9b000 Fix setting CoreAudio RT-priority 2020-02-24 04:38:49 +01:00
Robin Gareus
0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus
78a3683233 Consolidate relative sched_get_priority computation 2018-10-11 15:29:50 +02:00
Robin Gareus
c0dbe8eaaf Move coreaudio_set_realtime_policy into libpbd 2017-10-30 16:31:38 +01:00
Robin Gareus
229c9584bf Add a PBD API to set pthread priority 2017-08-29 17:25:23 +02:00
Robin Gareus
eec294a97e the endless quest to plug memory leaks -- episode 378 2016-07-25 17:16:32 +02:00
Paul Davis
0d9efc1148 redesign cross-thread registration/signalling system
This new design will work even when threads that need to receive
messages from RT threads are created *after* the RT threads. The
existing design would fail because the RT thread(s) would never
be known the later created threads, and so signals emitted by the
RT thread and causing call_slot() in the receiver would end up
being enqueued using a lock-protected list. The new design ensures
that communication always uses a lock-free FIFO instead
2015-12-28 10:14:17 -05:00
Robin Gareus
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis
4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Paul Davis
ee1b49f87e fix merge conflicts from master 2013-08-24 12:18:06 -04:00
Paul Davis
04bf9d1e95 fix newly-appearing crash-at-close caused by muddled thinking in pbd/pthread_utils
threads created with this code can now just return a value as they normally would, and the
infrastructure will ensure cleanup. there is no longer any reason to call pthread_exit_pbd()
and so that has been removed.
2013-08-15 11:44:47 -04:00