由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 顶这锅盖总结:Java/C#萨克斯,只有C/C++才是真正的low latency
相关主题
swift为啥让程序员自己搞循环引用?some C++ interview questions
objective-c有arc来自动release,和jave的gc一样,怎么就没有java那么明显的慢呢?C++ question
[合集] C++ question -- how to save objects关于effective c++的几个问题
问问开发ios的,有用C++来组织代码的么?C++ questions
C, C++, Java, C#, Objective-C,C++ interdependence question
[转载] Tcl/C++ questionC++疑问
C++ class cross reference problemmultithread program design pattern (C++)
请教一个C++有关的编译问题除了类,c++和C区别在那?
相关话题的讨论汇总
话题: arc话题: c++话题: objective话题: gc
进入Programming版参与讨论
1 (共1页)
a*****a
发帖数: 495
1
语言.
当然Fortran也算特里毒性的一种语言
p*********t
发帖数: 2690
2
问题是,如果一门语言太难了,学习曲线太陡了,就不利于人民的生产和生活。就象一
个工具太难使用了,這個时候,有一个免费又容易使用的工具,大家就都会选它。

【在 a*****a 的大作中提到】
: 语言.
: 当然Fortran也算特里毒性的一种语言

i*****o
发帖数: 1714
3
像java和c#这种要gc的,gc一来所有timing都off,根本不适合做real time的东西。还
是objective-c最牛,既不要gc,也没memory leak。还和c++一样快,可语法什么的比c
++简单不是一点点。用的人只怕越来越多。

【在 p*********t 的大作中提到】
: 问题是,如果一门语言太难了,学习曲线太陡了,就不利于人民的生产和生活。就象一
: 个工具太难使用了,這個时候,有一个免费又容易使用的工具,大家就都会选它。

g*****g
发帖数: 34805
4
这个你说的不对,gc pause不是必然的。首先gc有很多种不同算法,进行
的时候不必暂停heap allocation。其次gc可以在多个线程上,根据load
动态进行,而不是非要heap allocation过threshold时候触发。
有兴趣可以搜一下real time java.

比c

【在 i*****o 的大作中提到】
: 像java和c#这种要gc的,gc一来所有timing都off,根本不适合做real time的东西。还
: 是objective-c最牛,既不要gc,也没memory leak。还和c++一样快,可语法什么的比c
: ++简单不是一点点。用的人只怕越来越多。

i*****o
发帖数: 1714
5
问题是我怎么知道我用的是哪个java?

的时候不必暂停heap allocation。其次gc可以在多个线程上,根据load

【在 g*****g 的大作中提到】
: 这个你说的不对,gc pause不是必然的。首先gc有很多种不同算法,进行
: 的时候不必暂停heap allocation。其次gc可以在多个线程上,根据load
: 动态进行,而不是非要heap allocation过threshold时候触发。
: 有兴趣可以搜一下real time java.
:
: 比c

d**d
发帖数: 389
6
捧objective-c捧的真是符合你老人家的名字啊。

比c

【在 i*****o 的大作中提到】
: 像java和c#这种要gc的,gc一来所有timing都off,根本不适合做real time的东西。还
: 是objective-c最牛,既不要gc,也没memory leak。还和c++一样快,可语法什么的比c
: ++简单不是一点点。用的人只怕越来越多。

i*****o
发帖数: 1714
7
哈,名副其实。

【在 d**d 的大作中提到】
: 捧objective-c捧的真是符合你老人家的名字啊。
:
: 比c

r*********r
发帖数: 3195
8
how?

【在 i*****o 的大作中提到】
: 哈,名副其实。
g*****g
发帖数: 34805
9
You are not using real time java if you don't know.
And in most cases you don't need it. Most systems don't
care sub-second additional latency due to GC.

【在 i*****o 的大作中提到】
: 问题是我怎么知道我用的是哪个java?
:
: 的时候不必暂停heap allocation。其次gc可以在多个线程上,根据load

r****y
发帖数: 26819
10
maybe he means on ios :-) but no memory leak is nonsense.

【在 r*********r 的大作中提到】
: how?
相关主题
[转载] Tcl/C++ questionsome C++ interview questions
C++ class cross reference problemC++ question
请教一个C++有关的编译问题关于effective c++的几个问题
进入Programming版参与讨论
i*****o
发帖数: 1714
11
compiler 帮你加free().

【在 r*********r 的大作中提到】
: how?
i*****o
发帖数: 1714
12
为什么是none-sense?

【在 r****y 的大作中提到】
: maybe he means on ios :-) but no memory leak is nonsense.
r****y
发帖数: 26819
13
because objective-c is powerful enough to leak memory, even with autorelease.

【在 i*****o 的大作中提到】
: 为什么是none-sense?
i*****o
发帖数: 1714
14
这个是你自己的经验还是别的地方看到的?能不能具体点?
没别的意思啊,就是想看看是什么地方需要注意的。

autorelease.

【在 r****y 的大作中提到】
: because objective-c is powerful enough to leak memory, even with autorelease.
X****r
发帖数: 3557
15
You still need a clear idea on object ownership, just like
in C/C++. It is only a little harder to forget about a
free/delete especially with ARC (but ARC and non-ARC code
are tricky to mix). You can archive the same in C++ with
reference-counting smart pointers too.
On the other hand, auto release pool could have the same
'freeze' issue as in GC if you have accumulated too many
objects to release at once.
Overall I don't think how Objective C's model are far superior.
Slightly better, maybe, depends on one's taste.

【在 i*****o 的大作中提到】
: compiler 帮你加free().
F********g
发帖数: 475
16
C++稍微不注意就很大OVERHEAD。。。
i*****o
发帖数: 1714
17
I thought non-arc and arc code are not mixable, or it is just apple
discourages the mixing?
With arc, objects are released the moment they are deemed not needed, so
there shouldn't be any accumulative effect on the autorelease pool, right?
Still I feel objective-c is way simpler than c++. And delegate and category
are really nice features(I think they are unique to objective-c).

【在 X****r 的大作中提到】
: You still need a clear idea on object ownership, just like
: in C/C++. It is only a little harder to forget about a
: free/delete especially with ARC (but ARC and non-ARC code
: are tricky to mix). You can archive the same in C++ with
: reference-counting smart pointers too.
: On the other hand, auto release pool could have the same
: 'freeze' issue as in GC if you have accumulated too many
: objects to release at once.
: Overall I don't think how Objective C's model are far superior.
: Slightly better, maybe, depends on one's taste.

X****r
发帖数: 3557
18
It is possible to have ARC and non-ARC code mixed, either by
compiling into different static libraries, or by applying
different compiler flags manually, but it is hard to maintain at
best, and could lead to obscure errors if you're not careful, so
it is kind of defeating the purpose of ARC, thus the usual advice
is not to mix them unless the libraries have already provided
for you.
All ARC does it to make compiler add retain/release/autorelease
calls for you automatically. It won't fix issues in your design,
such as incorrect strong/weak references or crowded autorelease
pool.
I'm not questioning Objective-C is simpler than C++. It is actually
pretty hard not to be. Oh wait, there is Objective-C++...

category

【在 i*****o 的大作中提到】
: I thought non-arc and arc code are not mixable, or it is just apple
: discourages the mixing?
: With arc, objects are released the moment they are deemed not needed, so
: there shouldn't be any accumulative effect on the autorelease pool, right?
: Still I feel objective-c is way simpler than c++. And delegate and category
: are really nice features(I think they are unique to objective-c).

f*******5
发帖数: 10321
19
Object-C在Mac OSX上的GC是要动态扫的吧,你这个'the moment they are deemed not
needed'跟别的语言有啥区别?

category

【在 i*****o 的大作中提到】
: I thought non-arc and arc code are not mixable, or it is just apple
: discourages the mixing?
: With arc, objects are released the moment they are deemed not needed, so
: there shouldn't be any accumulative effect on the autorelease pool, right?
: Still I feel objective-c is way simpler than c++. And delegate and category
: are really nice features(I think they are unique to objective-c).

g*****g
发帖数: 34805
20
I think whatever Object-C can do would be easily borrowed by other
languages if it proves to be superior. There's no silver bullet.

not

【在 f*******5 的大作中提到】
: Object-C在Mac OSX上的GC是要动态扫的吧,你这个'the moment they are deemed not
: needed'跟别的语言有啥区别?
:
: category

相关主题
C++ questionsmultithread program design pattern (C++)
C++ interdependence question除了类,c++和C区别在那?
C++疑问dynamic_cast operator in C++
进入Programming版参与讨论
i*****o
发帖数: 1714
21
不知道osx上是怎么做的,arc是新东西,估计应该首先放到ios上,再放到mac上。不过
这个是语言上的,和platform无关,只要compiler支持就好了。

not

【在 f*******5 的大作中提到】
: Object-C在Mac OSX上的GC是要动态扫的吧,你这个'the moment they are deemed not
: needed'跟别的语言有啥区别?
:
: category

d***q
发帖数: 1119
22
real-time means behaviour is predictable. it has nothing to do with fast..
as far as I know most of gc implemetations are not predictable.
g*****g
发帖数: 34805
23
That's correct, real time means no stop the world gc pause beyond
certain small threshold. It doesn't have better performance. But it's
suitable where there's low latency requirement.

【在 d***q 的大作中提到】
: real-time means behaviour is predictable. it has nothing to do with fast..
: as far as I know most of gc implemetations are not predictable.

G***l
发帖数: 355
24
gc不代表会pause,要看具体的实现。
那种并发很多而且要求low latency的系统都是有很多server。我不知道有没有类似这
种技术的实现,比如当一个request发到其中一个server上,那个server因为某些原因
没法快速给出结果,在一定threshold内得不到响应,系统自动把request转发到别的
server上并像之前那个server取消请求。这样就算request发到某个server不能很快回
复,也能转发利用别的有空闲的server。

【在 g*****g 的大作中提到】
: That's correct, real time means no stop the world gc pause beyond
: certain small threshold. It doesn't have better performance. But it's
: suitable where there's low latency requirement.

c****e
发帖数: 1453
25
It's starndard pratice. The request is broadcasted to a group of servers.
Either you have a decicated aggregator or a group header on rotate.

【在 G***l 的大作中提到】
: gc不代表会pause,要看具体的实现。
: 那种并发很多而且要求low latency的系统都是有很多server。我不知道有没有类似这
: 种技术的实现,比如当一个request发到其中一个server上,那个server因为某些原因
: 没法快速给出结果,在一定threshold内得不到响应,系统自动把request转发到别的
: server上并像之前那个server取消请求。这样就算request发到某个server不能很快回
: 复,也能转发利用别的有空闲的server。

1 (共1页)
进入Programming版参与讨论
相关主题
除了类,c++和C区别在那?C, C++, Java, C#, Objective-C,
dynamic_cast operator in C++[转载] Tcl/C++ question
问两个问题,C++C++ class cross reference problem
两个看来相似的问题请教一个C++有关的编译问题
swift为啥让程序员自己搞循环引用?some C++ interview questions
objective-c有arc来自动release,和jave的gc一样,怎么就没有java那么明显的慢呢?C++ question
[合集] C++ question -- how to save objects关于effective c++的几个问题
问问开发ios的,有用C++来组织代码的么?C++ questions
相关话题的讨论汇总
话题: arc话题: c++话题: objective话题: gc