Commit Graph

50 Commits

Author SHA1 Message Date
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
John Emmas 7b480eaa27 Windows (compiler specific) includes for libpbd 2013-07-16 18:00:49 +01:00
Paul Davis 227cf470ba Use a std::list instead of std::set for the ThreadMap in libpbd
pthread_t can't work with std::set using the pthread lib on windows
as there is no operator< defined for the type
2013-07-11 11:43:43 -04:00
Paul Davis 117118e5f0 Use pthread_equals in libpbd for portability 2013-07-11 11:40:59 -04:00
Paul Davis 3cd8138a41 convert from Glib:: to Glib::Threads for all thread-related API
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25 17:48:55 +00:00
Tim Mayberry 6262eae7c0 Remove unnecessary header includes
git-svn-id: svn://localhost/ardour2/branches/3.0@12827 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 03:51:41 +00:00
Paul Davis 8ae20c0c4d stop metering thread as we disconnect a session from audioengine; explicitly drop connections early in ~Route so that we don't still have signals being handled while we destruct; fix up some valgrind warnings
git-svn-id: svn://localhost/ardour2/branches/3.0@6425 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-31 19:49:22 +00:00
Paul Davis 35c72a53b4 change the way thread name is managed and accessed; store thread name for JACK thread(s); remove bits of debugging output
git-svn-id: svn://localhost/ardour2/branches/3.0@6399 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-26 16:15:11 +00:00
Paul Davis c83389b8ec cleanup up cleanup at session destruction; clarify the meaning of 3 signals (DropReferences & Destroyed in libardour ; CatchDeletion in the GTK UI); clarify ownership of objects (session no longer pays attention to DropReferences for objects that it is considered to own, such as routes, sources, etc); fix up MIDI parsing and a couple of other places by correcting syntax for return of values from a boost::signals2::signal (possible danger elsewhere to be checked)
git-svn-id: svn://localhost/ardour2/branches/3.0@6389 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-22 20:21:43 +00:00
Paul Davis b8b55ef003 OSC is now driven by an event loop; fix up lifetime mgmt of Glib::Source to workaround bug in Glib
git-svn-id: svn://localhost/ardour2/branches/3.0@6329 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-09 18:37:06 +00:00
Paul Davis c38e02285f major design changes: use glib event loop for MIDI thread/UI; rework design of BaseUI and AbstractUI; solo & mute are both temporarily broken; OSC control up next; may segfault during exit
git-svn-id: svn://localhost/ardour2/branches/3.0@6328 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-12-09 03:05:14 +00:00
Paul Davis a4b8955f3e part 2 of 3 of the 2.8 -> 3.0 merge
git-svn-id: svn://localhost/ardour2/branches/3.0@4987 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-16 16:02:25 +00:00
David Robillard e0aaed6d65 *** NEW CODING POLICY ***
All #include statements that include a header that is a part of a library
bundled with ardour MUST use quotes, not angle brackets.

Do this:

#include "ardour/types.h"

NOT this:

#include <ardour/types.h>

Rationale:

This is best practice in general, to ensure we include the local version
and not the system version.  That quotes mean "local" (in some sense)
and angle brackets mean "system" (in some sense) is a ubiquitous
convention and IIRC right in the C spec somewhere.

More pragmatically, this is required by (my) waf (stuff) for dependencies
to work correctly.  That is:

!!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!!

Failure to comply is punishable by death by torture. :)

P.S. It's not that dramatic in all cases, but this (in combination with some
GCC flags specific to the include type) is the best way I have found to be
absolutely 100% positive the local ones are being used (and we definitely
want to be absolutely 100% positive on that one).


git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25 18:26:51 +00:00
Paul Davis bc89fe0147 most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-12 14:43:24 +00:00
Paul Davis 449aab3c46 rollback to 3428, before the mysterious removal of libs/* at 3431/3432
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02 21:41:35 +00:00
Doug McLain 9c0d7d72d7 remove empty sigc++2 directory
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02 05:02:28 +00:00
David Robillard 2d62ded1aa Reduced allocated stack sizes. Trims about 13MB of memory consumption.
git-svn-id: svn://localhost/ardour2/trunk@1293 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-01-10 03:26:22 +00:00
Taybin Rutkin 481f7c3965 Fixed i18n system.
Renamed pbd3 back to pbd, since it's version 4.1 now.
Very minor fixes


git-svn-id: svn://localhost/ardour2/trunk@656 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-06-29 22:21:30 +00:00