Why was cooperative thread cancellation removed from C++0x

2126 views
Skip to first unread message

restor

unread,
Jun 8, 2010, 6:49:45 PM6/8/10
to
Hi,
I have been using Boost's thread cooperative cancellation mechanism
for a while and found it very useful. I know it was considered for C+
+0x and then finally rejected. I only found the following note.

<< WG 14 notes with satisfaction the progress made towards a thread
API in WG 21 reported by its liaisons. WG 14 also notes that much of
this progress was made possible by the removal of the cooperative
cancellation/interruption part of the API. This aspect had previously
caused concern in WG 14, and the working group wishes to thank WG 21
for this significant improvement. However, WG 14 also notes that the
=93Scope=94 motions passed by WG 21 do not explicitly remove cooperative
cancellation from the scope of the revision. WG 14 would have serious
liaison concerns should the concept of cooperative cancellation
reappear, and urge WG 21 to explicitly remove it from the scope of
this revision. >>

I am not sure if I read it correctly, but it looks like the feature
was not compatible with the ISO C threads. I do not understand why C++
cannot simply add this feature atop the C-compatible thread mechanism.
Are there any issues with the cooperative thread cancellation?

Regards,
&rzej


--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use
mailto:std...@netlab.cs.rpi.edu<std-c%2B%2...@netlab.cs.rpi.edu>
]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Anthony Williams

unread,
Jun 9, 2010, 1:54:23 PM6/9/10
to
restor <akrz...@gmail.com> writes:

> Are there any issues with the cooperative thread cancellation?

Cancellation was removed from the proposal because consensus could not
be reached amongst the C++ committee. Removal of cancellation allowed
the non-contentious portion of the proposal to be voted into the draft.

A key point of disagreement was whether cancellation should be "sticky",
and thus uncatchable or automatically getting rethrown if caught, or a
normal catchable exception, thus allowing a thread to catch, handle and
discard cancellation requests.

Anthony
--
Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/
just::thread C++0x thread library http://www.stdthread.co.uk
Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Mathias Gaunard

unread,
Jun 9, 2010, 1:54:23 PM6/9/10
to
On 8 juin, 23:49, restor <akrze...@gmail.com> wrote:

> I am not sure if I read it correctly, but it looks like the feature
> was not compatible with the ISO C threads. I do not understand why C++
> cannot simply add this feature atop the C-compatible thread mechanism.

> Are there any issues with the cooperative thread cancellation?

I can see the link with C, as it's based on exceptions, which C does
not have.
This is probably concern due to mixing C code in C++ threads.

--

Alexander Terekhov

unread,
Jun 11, 2010, 7:59:40 PM6/11/10
to
Anthony Williams wrote:
[...]

> A key point of disagreement was whether cancellation should be "sticky",
> and thus uncatchable or automatically getting rethrown if caught, or a
> normal catchable exception, thus allowing a thread to catch, handle and
> discard cancellation requests.

And how does NO CANCELLATION AT ALL satisfy "sticky" folks?

regards,
alexander.

--

Anthony Williams

unread,
Jun 16, 2010, 4:33:57 AM6/16/10
to
Alexander Terekhov <tere...@web.de> writes:

> Anthony Williams wrote:
> [...]
>> A key point of disagreement was whether cancellation should be "sticky",
>> and thus uncatchable or automatically getting rethrown if caught, or a
>> normal catchable exception, thus allowing a thread to catch, handle and
>> discard cancellation requests.
>
> And how does NO CANCELLATION AT ALL satisfy "sticky" folks?

It doesn't --- there was no consensus, so the issue was dropped. This
means that those that wanted the feature miss out, but that's always the
way with C++ standards proposals; no consensus => no change.

Anthony
--
Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/
just::thread C++0x thread library http://www.stdthread.co.uk
Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@netlab.cs.rpi.edu]

Reply all
Reply to author
Forward
0 new messages