Home » Community » Coffee corner » C++ FQA
| Re: C++ FQA [message #12621 is a reply to message #12618] |
Sun, 11 November 2007 09:54   |
 |
mirek
Messages: 14273 Registered: November 2005
|
Ultimate Member |
|
|
| mdelfede wrote on Sat, 10 November 2007 17:57 |
| luzr wrote on Sat, 10 November 2007 17:54 |
| cbpporter wrote on Sat, 10 November 2007 11:31 |
And I'm quite surprised to see people who don't like gc, but have nothing against reference counting, which is slower and almost impossible to use efficiently in a multi-threading application.
|
I mostly agree with this...
|
As with GC, refcount can be made thread safe, IMHO.
|
The things is that even thread unsafe reference counting is about as fast or slower than mark&sweep GC.
And, w.r.t. thread safety, the another trouble is that you cannot safely use atomic operations only when the object is really shared between threads (when it is needed).
| Quote: |
Even pick_ can be not thread safe, if it's bad coded, and must have some sort of synchronizing code to be thread safe.
|
Everything can be thread unsafe if you really try. Anyway, the simplest pick_ implementation is naturaly thread safe.
| Quote: |
I would not accept a language based mostly on GC, but I've got nothing against an optional gc among other management stuffs.
|
The problem is that this is not quite possible.
| Quote: |
BTW, I can't see how refcount can be slower than GC... maybe I'm wrong, but I'd like to have it explained !
|
OK, only think about the amount of operations that have to be performed in simple "return the value" scenario
RefCounted<Foo> Fn() {
RefCounted<Foo> x = new Foo;
.....
return x;
}
void Fn2() {
RefCounted<Foo> y = new Foo;
...
y = Fn();
}
Mirek
|
|
|
|
 |
|
C++ FQA
By: unodgs on Tue, 06 November 2007 23:27
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: unodgs on Wed, 07 November 2007 10:40
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: unodgs on Wed, 07 November 2007 13:15
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Thu, 08 November 2007 05:34
|
 |
|
Re: C++ FQA
By: Zardos on Thu, 08 November 2007 13:33
|
 |
|
Re: C++ FQA
By: mirek on Thu, 08 November 2007 19:25
|
 |
|
Re: C++ FQA
By: mdelfede on Thu, 08 November 2007 23:39
|
 |
|
Re: C++ FQA
By: mirek on Fri, 09 November 2007 08:51
|
 |
|
Re: C++ FQA
By: mdelfede on Fri, 09 November 2007 13:41
|
 |
|
Re: C++ FQA
By: mirek on Fri, 09 November 2007 14:48
|
 |
|
Re: C++ FQA
By: mdelfede on Fri, 09 November 2007 15:52
|
 |
|
Re: C++ FQA
By: waxblood on Fri, 09 November 2007 17:07
|
 |
|
Re: C++ FQA
By: mdelfede on Fri, 09 November 2007 19:51
|
 |
|
Re: C++ FQA
By: mirek on Sat, 10 November 2007 15:14
|
 |
|
Re: C++ FQA
By: mdelfede on Sat, 10 November 2007 17:06
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Sat, 10 November 2007 17:54
|
 |
|
Re: C++ FQA
By: mdelfede on Sat, 10 November 2007 23:57
|
 |
|
Re: C++ FQA
By: mirek on Sun, 11 November 2007 09:54
|
 |
|
Re: C++ FQA
By: mdelfede on Sun, 11 November 2007 11:25
|
 |
|
Re: C++ FQA
By: Zardos on Tue, 13 November 2007 01:56
|
 |
|
Re: C++ FQA
By: mirek on Tue, 13 November 2007 09:25
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Tue, 13 November 2007 10:52
|
 |
|
Re: C++ FQA
By: mirek on Thu, 22 November 2007 05:43
|
 |
|
Re: C++ FQA
By: mdelfede on Sun, 11 November 2007 11:36
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mdelfede on Sun, 11 November 2007 18:52
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Mon, 12 November 2007 09:46
|
 |
|
Re: C++ FQA
By: mdelfede on Mon, 12 November 2007 10:19
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mdelfede on Mon, 12 November 2007 11:43
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mdelfede on Mon, 12 November 2007 16:47
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Mon, 12 November 2007 20:15
|
 |
|
Re: C++ FQA
By: mirek on Mon, 12 November 2007 20:21
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Mon, 12 November 2007 22:43
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Mon, 12 November 2007 23:34
|
 |
|
Re: C++ FQA
By: mdelfede on Mon, 12 November 2007 23:33
|
 |
|
Re: C++ FQA
By: exolon on Tue, 13 November 2007 17:30
|
 |
|
Re: C++ FQA
By: mdelfede on Tue, 13 November 2007 18:24
|
 |
|
Re: C++ FQA
By: exolon on Tue, 13 November 2007 18:58
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mirek on Fri, 16 November 2007 11:59
|
 |
|
Re: C++ FQA
By: waxblood on Fri, 16 November 2007 16:24
|
 |
|
Re: C++ FQA
By: mdelfede on Fri, 16 November 2007 16:37
|
 |
|
Re: C++ FQA
By: mirek on Sat, 17 November 2007 10:04
|
 |
|
Re: C++ FQA
By: mirek on Sat, 10 November 2007 15:22
|
 |
|
Re: C++ FQA
By: mdelfede on Sat, 10 November 2007 16:58
|
 |
|
Re: C++ FQA
By: mirek on Thu, 08 November 2007 05:25
|
 |
|
Re: C++ FQA
By: mirek on Wed, 07 November 2007 15:14
|
 |
|
Re: C++ FQA
By: mdelfede on Wed, 07 November 2007 15:39
|
 |
|
Re: C++ FQA
By: exolon on Mon, 12 November 2007 13:09
|
 |
|
Re: C++ FQA
By: mr_ped on Wed, 07 November 2007 17:05
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
By: mr_ped on Sat, 10 November 2007 22:26
|
 |
|
Re: C++ FQA
By: mirek on Sat, 10 November 2007 22:35
|
 |
|
Re: C++ FQA
|
 |
|
Re: C++ FQA
|
Goto Forum:
Current Time: Sat Nov 29 09:45:01 CET 2025
Total time taken to generate the page: 0.09736 seconds
|