Tarantool development patches archive
 help / color / mirror / Atom feed
From: lvasiliev <lvasiliev@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>,
	alexander.turenko@tarantool.org,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] Add some cancellation guard
Date: Mon, 23 Mar 2020 09:43:59 +0300	[thread overview]
Message-ID: <8db85e49-c479-779b-7459-6ea6727ecb98@tarantool.org> (raw)
In-Reply-To: <20200318082610.GA26019@atlas>



On 18.03.2020 11:26, Konstantin Osipov wrote:
> * Leonid Vasiliev <lvasiliev@tarantool.org> [19/12/26 10:51]:
>> We need to set a thread cancellation guard, because
>> another thread may cancel the current thread at a
>> really bad time (messages flush, mutex lock)
>>
>> Fixes: #4127
> 
> I think we have to do this patch, as long as we use
> pthread_cancel().
> 
> An alternative is to ignore the bug. There is no harm in Tarantool
> in crashing at exit, as long as we close the wal first.
> 
> And we should close the wal first!
> 
> AFAIU pthread_setcancellable is a thread-local and cheap
> operation. Could you please confirm this? (I haven't studied the
> pthread implementation code since 2001, when Linux only had Xavier
> Leroy's threads).

Hi! Yes, it is a thread local. About cheap (a comment from the code): 
"The atomic operation can potentially be expensive if the memory has to 
be locked and remote cache lines have to be invalidated." But, if I am 
understand correctly, it should not affect us.

> 
> 

  reply	other threads:[~2020-03-23  6:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26  7:46 Leonid Vasiliev
2020-03-16 11:23 ` Cyrill Gorcunov
2020-03-17 18:49   ` Georgy Kirichenko
2020-03-17 19:16     ` Cyrill Gorcunov
2020-03-18  9:00   ` lvasiliev
2020-03-18  9:34     ` Cyrill Gorcunov
2020-03-18  8:26 ` Konstantin Osipov
2020-03-23  6:43   ` lvasiliev [this message]
2020-03-20 11:17 ` Kirill Yukhin

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=8db85e49-c479-779b-7459-6ea6727ecb98@tarantool.org \
    --to=lvasiliev@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] Add some cancellation guard' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox