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


Author: restor <akrzemi1@gmail.com>
Date: Tue, 8 Jun 2010 16:49:45 CST
Raw View
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-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: Anthony Williams <anthony.ajw@gmail.com>
Date: Wed, 9 Jun 2010 11:54:23 CST
Raw View
restor <akrzemi1@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

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





Author: Mathias Gaunard <loufoque@gmail.com>
Date: Wed, 9 Jun 2010 11:54:23 CST
Raw View
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.

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





Author: Alexander Terekhov <terekhov@web.de>
Date: Fri, 11 Jun 2010 17:59:40 CST
Raw View
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.

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





Author: Alexander Terekhov <terekhov@web.de>
Date: Fri, 11 Jun 2010 18:00:49 CST
Raw View
restor wrote:
[...]
> Are there any issues with the cooperative thread cancellation?

See

http://www.codesourcery.com/archives/c++-pthreads/mail16.html
http://www.codesourcery.com/archives/c++-pthreads/mail15.html
http://www.codesourcery.com/archives/c++-pthreads/mail14.html
http://www.codesourcery.com/archives/c++-pthreads/mail13.html
http://www.codesourcery.com/archives/c++-pthreads/mail12.html
http://www.codesourcery.com/archives/c++-pthreads/mail11.html
http://www.codesourcery.com/archives/c++-pthreads/mail10.html
http://www.codesourcery.com/archives/c++-pthreads/mail9.html
http://www.codesourcery.com/archives/c++-pthreads/mail8.html
http://www.codesourcery.com/archives/c++-pthreads/mail7.html
http://www.codesourcery.com/archives/c++-pthreads/mail6.html
http://www.codesourcery.com/archives/c++-pthreads/mail5.html
http://www.codesourcery.com/archives/c++-pthreads/mail4.html
http://www.codesourcery.com/archives/c++-pthreads/mail3.html
http://www.codesourcery.com/archives/c++-pthreads/mail2.html
http://www.codesourcery.com/archives/c++-pthreads/maillist.html

Hth.

regards,
alexander.

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





Author: Anthony Williams <anthony.ajw@gmail.com>
Date: Wed, 16 Jun 2010 02:33:57 CST
Raw View
Alexander Terekhov <terekhov@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-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]