Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
5735fdde
Commit
5735fdde
authored
Sep 13, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for (compile-time) custom stack size
parent
62d3bf8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
src/misc/threads.c
src/misc/threads.c
+19
-0
No files found.
src/misc/threads.c
View file @
5735fdde
...
...
@@ -689,6 +689,25 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
pthread_attr_setschedparam
(
&
attr
,
&
sp
);
}
/* The thread stack size.
* The lower the value, the less address space per thread, the highest
* maximum simultaneous threads per process. Too low values will cause
* stack overflows and weird crashes. Set with caution. Also keep in mind
* that 64-bits platforms consume more stack than 32-bits one.
*
* Thanks to on-demand paging, thread stack size only affects address space
* consumption. In terms of memory, threads only use what they need
* (rounded up to the page boundary).
*
* For example, on Linux i386, the default is 2 mega-bytes, which supports
* about 320 threads per processes. */
#define VLC_STACKSIZE (128 * sizeof (void *) * 1024)
#ifdef VLC_STACKSIZE
ret
=
pthread_attr_setstacksize
(
&
attr
,
VLC_STACKSIZE
);
assert
(
ret
==
0
);
/* fails iif VLC_STACKSIZE is invalid */
#endif
ret
=
pthread_create
(
p_handle
,
&
attr
,
entry
,
data
);
pthread_sigmask
(
SIG_SETMASK
,
&
oldset
,
NULL
);
pthread_attr_destroy
(
&
attr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment