From: Mikhail Efremov <sem@altlinux.ru>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] Q: Очень непростой вопрос на тему select() и сигналов
Date: Fri, 10 Apr 2009 13:40:09 +0400
Message-ID: <200904101340.09544.sem@altlinux.ru> (raw)
In-Reply-To: <m3bpr5gtva.fsf@blard.localdomain>
On Friday 10 April 2009 05:50:01 Michael Pozhidaev wrote:
> Ага, спасибо! Но переспрошу ещё раз:
> 1. я заблокировал SIGCHLD;
> 2. после этого SIGCHLD был послан моему процессу;
> 3. я вызвал pselect() у которого в маске SIGCHLD разрешён;
> 4. pselect() увидит, что за период блокировки сигнала он был пойман и
> СРАЗУ ЖЕ ЗАВЕРШИТ свою работу с EINTR.
> При этом обработчик сигнала будет вызван, просто немного отложен.
> Правильно? Это гарантируется системой? Трюк с pipe(), чтобы
> проинформировать о сигнале пока трогать не буду. Потом может как-нибудь.
Все так, это гарантируется стандартом. Вот только стандарт стандартом, а его
конкретная реализация - это конкретная реализация, в той или иной степени
этот стандарт поддерживающая. Раньше в Linux не было системного вызова
pselect, была эмуляция в glibc, проблемы не решающая. Начиная с 2.6.какой-то
версии ядра такой вызов есть, но я не знаю как он работает. Впрочем, не
думаю, что есть смысл делать системный вызов, не решающий проблему с race.
Может кто из знатоков ядра скажет по этому поводу больше.
--
WBR, Mikhail Efremov
next prev parent reply other threads:[~2009-04-10 9:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 22:48 Michael Pozhidaev
2009-04-09 23:49 ` Mikhail Efremov
2009-04-10 1:50 ` Michael Pozhidaev
2009-04-10 9:40 ` Mikhail Efremov [this message]
2009-04-10 12:36 ` Sergey Vlasov
2009-04-10 16:00 ` Michael Pozhidaev
2009-04-10 16:22 ` Mikhail Efremov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904101340.09544.sem@altlinux.ru \
--to=sem@altlinux.ru \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git