nixp.ru v3.0

29 мая 2017,
понедельник,
12:40:00 MSK

DevOps с компанией «Флант»
Longobard написал 26 августа 2004 года в 16:34 (407 просмотров) Ведет себя как мужчина; открыл 291 тему в форуме, оставил 2499 комментариев на сайте.

Читал сегодня Стивенса на досуге — наткунался на интересную вещь. Он упоминает про функцию pthread_setconcurrency() , которая по сути является аналогом nice() для pthread потоков. Мана по ней нету — не нашел я его. В сырцах ядра такого слова не обнаружено. Вопрос: почему убрали енту функцию, или можеть ее переименовали?

Longobard

Гугль ничего вразумительного не ответил.

Longobard


longobard linux # cd /usr/src/linux-2.6.8.1-ck1
longobard linux # grep -R "concurrency" *
arch/mips/kernel/irq_cpu.c: * to deal with concurrency issues.  Same for mips_cpu_irq_end.
arch/mips/kernel/irq-rm7000.c: * to deal with concurrency issues.  Same for rm7k_cpu_irq_end.
arch/um/kernel/um_arch.c: * and changed at address space creation time so this poses no concurrency
arch/ia64/kernel/perfmon.c: *   - we need to protect against CPU concurrency (spin_lock)
arch/ia64/kernel/perfmon.c: *           because we know we will not get PMU concurrency in that code.
arch/ia64/kernel/perfmon.c:      * access, not CPU concurrency.
arch/ia64/kernel/perfmon.c:      * access, not CPU concurrency.
arch/ia64/kernel/perfmon.c:      * concurrency even without interrupt masking.
Documentation/DocBook/kernel-locking.tmpl:     fundamentals of concurrency and locking for
Documentation/DocBook/kernel-locking.tmpl:      The piece of code containing the concurrency issue is called a
Documentation/DocBook/kernel-locking.tmpl:       time, where there is no concurrency), and the list of registrations
Documentation/DocBook/kernel-locking.tmpl:some code which does locking.  First is concurrency: how many things
Documentation/preempt-locking.txt:those under SMP: concurrency and reentrancy.  Thankfully, the Linux preemptible
drivers/net/3c505.c: * probably be done better; the concurrency protection is particularly awful.
drivers/char/ip2/i2lib.c:// atomiticity/concurrency issues that result.
drivers/acpi/executer/exdump.c:         acpi_ex_out_integer ("Concurrency",  obj_desc->method.concurrency);
drivers/acpi/executer/excreate.c:        * Get the concurrency count.  If required, a semaphore will be
drivers/acpi/executer/excreate.c:               obj_desc->method.concurrency = 1;
drivers/acpi/executer/excreate.c:               obj_desc->method.concurrency = (u8)
drivers/acpi/executer/excreate.c:               obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY;
drivers/acpi/dispatcher/dsmethod.c:     /* Create a mutex for the method if there is a concurrency limit */
drivers/acpi/dispatcher/dsmethod.c:     if ((obj_desc->method.concurrency != ACPI_INFINITE_CONCURRENCY) &&
drivers/acpi/dispatcher/dsmethod.c:             status = acpi_os_create_semaphore (obj_desc->method.concurrency,
drivers/acpi/dispatcher/dsmethod.c:                                obj_desc->method.concurrency,
drivers/acpi/dispatcher/dsmethod.c:      * If there is a concurrency limit on this method, we need to
drivers/acpi/dispatcher/dsmethod.c:              * Allow recursive method calls, up to the reentrancy/concurrency
drivers/acpi/dispatcher/dsmethod.c:                     if (obj_desc->method.thread_count >= obj_desc->method.concurrency) {
drivers/acpi/dispatcher/dsmethod.c:     /* Init for new method, wait on concurrency semaphore */
drivers/acpi/dispatcher/dsmethod.c:             if ((walk_state->method_desc->method.concurrency == 1) &&
drivers/acpi/parser/psparse.c:                          walk_state->method_desc->method.concurrency = 1;
drivers/acpi/parser/psxface.c:  /* Init for new method, wait on concurrency semaphore */
drivers/usb/misc/auerswald.c:   It is assumed that there is no concurrency while setting up the chain
drivers/usb/misc/auerswald.c:   NOTE: there is no concurrency at _init
drivers/usb/misc/auerswald.c:   NOTE: there is no concurrency at _cleanup
drivers/mtd/maps/ichxrom.c:     /* FIXME do I need to guard against concurrency here? */
drivers/mtd/maps/ich2rom.c:     /* FIXME do I need to guard against concurrency here? */
fs/xfs/quota/xfs_dquot.c:        * concurrency, and we don't want to take locks on the entire buffers
include/acpi/acobject.h:        u8                                      concurrency;
include/linux/usb.h: * concurrency issues with respect to open() and close() methods, as

Мабуть ее переименовали?

vnp
LONGOBARD

longobard linux # cd /usr/src/linux-2.6.8.1-ck1
longobard linux # grep -R "concurrency" *

Мабуть ее переименовали?

Ммм… зачем же в кернеле искать?

> nm /usr/lib/libpthread.a | grep concurrency
00000ba0 T __pthread_getconcurrency
00000bac T __pthread_setconcurrency
00000ba0 W pthread_getconcurrency
00000bac W pthread_setconcurrency

А google вполне вразумителен:

GLib tries to handle threads from an abstract perspective to make them

more portable. pthread_setconcurrency generally only makes sense for

platforms with m-to-n thread (pthread_setconcurrency sets 'n’). And this

is a implementation detail. If a program really needs it (which of

course can happen, but it should be rare), it has to to directly use the

underlying thread platform. Note however, that most thread

implementations nowadays are 1-to-1, most notably Linux. There

pthread_setconcurrency does not make any sense at all.

т.е. pthread_setconcurrency — не вполне nice, аналог которой, скорее, pthread_setschedparam.

Longobard

А где ман по этой функции? Я не нашел такого :(

Uncle Theodore
LONGOBARD
А где ман по этой функции? Я не нашел такого :(

У меня на десятой Слаке есть: man 3 pthread_setschedparam

Ну и на Гугле: http://www2.yo-linux.com/cgi-bin/man.cgi?section=all&topic=pthread_setschedparam

Good Luck,

UT