aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_async.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-02-23 18:26:38 +0100
committerLukas Larsson <[email protected]>2014-02-24 15:16:07 +0100
commita35d0f5f82f8152f1b953eda039807a7d4f4e9b9 (patch)
tree0410287577061d3ed630e76608bc865613c2b19d /erts/emulator/beam/erl_async.c
parent2bf4f22a9488d94ac1fc3c72a4e9d84151744004 (diff)
downloadotp-a35d0f5f82f8152f1b953eda039807a7d4f4e9b9.tar.gz
otp-a35d0f5f82f8152f1b953eda039807a7d4f4e9b9.tar.bz2
otp-a35d0f5f82f8152f1b953eda039807a7d4f4e9b9.zip
ose: Thread priorities configurable from lmconf
The pattern used for getting the priority from the lmconf is based on the name of the process created. The pattern is: ERTS_%%PROCESS_NAME%%_PRIO with the %%PROCESS_NAME%% replaced by the prefix of the process the priority applies to. eg: ERTS_SCHEDULER_PRIO=24 applies to processes with name SCHEDULER_1, SCHEDULER_2 etc.
Diffstat (limited to 'erts/emulator/beam/erl_async.c')
-rw-r--r--erts/emulator/beam/erl_async.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c
index afb5bc302f..b3dc327704 100644
--- a/erts/emulator/beam/erl_async.c
+++ b/erts/emulator/beam/erl_async.c
@@ -166,6 +166,7 @@ async_ready_q(Uint sched_id)
#endif
+
void
erts_init_async(void)
{
@@ -226,18 +227,23 @@ erts_init_async(void)
thr_opts.suggested_stack_size
= erts_async_thread_suggested_stack_size;
-#ifdef ETHR_HAVE_THREAD_NICENESS
- thr_opts.prio += 2;
-#endif
#ifdef ETHR_HAVE_THREAD_NAMES
- thr_opts.name = "async_thread";
+ thr_opts.name = malloc(sizeof(char)*(strlen("async_XXXX")+1));
#endif
for (i = 0; i < erts_async_max_threads; i++) {
ErtsAsyncQ *aq = async_q(i);
+
+#ifdef ETHR_HAVE_THREAD_NAMES
+ sprintf(thr_opts.name, "async_%d", i+1);
+#endif
+
erts_thr_create(&aq->thr_id, async_main, (void*) aq, &thr_opts);
}
+#ifdef ETHR_HAVE_THREAD_NAMES
+ free(thr_opts.name);
+#endif
/* Wait for async threads to initialize... */
erts_mtx_lock(&async->init.data.mtx);