This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 各位用C/C++的同学,有没有非用C不可的地方,用C++不行?
-oasis(oasis);
2006-2-16
(#2787749@0)
-
在只有C编译器,没有C++编译器的时候。
-mot95(mot95);
2006-2-16
(#2787790@0)
-
这不是脑筋急转弯
-oasis(oasis);
2006-2-16
(#2787885@0)
-
size and speed. like kernel/driver
-xordos(donothing);
2006-2-17
(#2789387@0)
-
kernel下用C++也只能用一部分. 有些东西如RTL没有kernel支持
-laoliang(老亮);
2006-2-17
(#2789397@0)
-
Yes. Even class. Do you know when the global object contruct in kernel? When loaded?
-iwantcar(EnjoyStudying);
2006-2-18
(#2790155@0)
-
global object is not supported in kernel. You need to write support code and could find example on internet.
-laoliang(老亮);
2006-2-20
(#2794898@0)
-
Thanks.
-iwantcar(EnjoyStudying);
2006-2-20
(#2795732@0)
-
难在非上
-frankwoo(柳五随风);
2006-2-17
(#2789270@0)
-
you got the point!
-oasis(oasis);
2006-2-17
(#2789416@0)
-
hehe,too tough a question. once some one asked me when should not let select() blocked? same as this quiz:)
-frankwoo(柳五随风);
2006-2-17
(#2789640@0)
-
WOW. What did you tell him?
-aka(棒棒);
2006-2-18
(#2790541@0)
-
in specific OS, select in a thread would block all the process, so you have to let the select poll instaed of blocking.
-frankwoo(柳五随风);
2006-2-18
(#2790613@0)
-
not very good answer. When there is no more data for select for long long long .............. All OS has this problem.
-iwantcar(EnjoyStudying);
2006-2-20
(#2793547@0)
-
absolutely wrong!
-frankwoo(柳五随风);
2006-2-20
(#2793950@0)
-
why
-iwantcar(EnjoyStudying);
2006-2-20
(#2794138@0)
-
not every OS would block the whole process by selecting in a thread, so far only BSD 4/5 has this problem.
-frankwoo(柳五随风);
2006-2-20
(#2794175@0)
-
VXWORKS
-iwantcar(EnjoyStudying);
2006-2-20
(#2794200@0)
-
so what is your point?
-frankwoo(柳五随风);
2006-2-20
(#2794398@0)
-
VXWORKS has this problem
-iwantcar(EnjoyStudying);
2006-2-20
(#2794478@0)
-
I think linux has this problem too, because it support select. I think all OS support select function has this problem.
-iwantcar(EnjoyStudying);
2006-2-20
(#2794480@0)
-
you must be kidding.
-frankwoo(柳五随风);
2006-2-20
(#2794655@0)
-
no kidding. And I don't want to argue about these things. put this problem aside for the time being please.
-iwantcar(EnjoyStudying);
2006-2-20
(#2794701@0)
-
It is not about all processes too.
-iwantcar(EnjoyStudying);
2006-2-20
(#2793662@0)
-
maybe I should say the whole process.
-frankwoo(柳五随风);
2006-2-20
(#2793959@0)
-
1.Set socket to non-block. 2. Use select() with timeout parameter
-google2002(Google);
2006-2-20
(#2793573@0)
-
I doubt you knwo what the question was about? it was not about how -to, it was about why?
-frankwoo(柳五随风);
2006-2-20
(#2793615@0)
-
His answer is not so bad. That is very typical senario.
-iwantcar(EnjoyStudying);
2006-2-20
(#2793661@0)
-
难在非上,基于此,他de答案不对。
-frankwoo(柳五随风);
2006-2-20
(#2793949@0)
-
To be honest, I don't understand your question. Maybe you can describe it in Chinese again or give more details
-google2002(Google);
2006-2-20
(#2794310@0)
-
什么时候你只能让select非阻塞。
-frankwoo(柳五随风);
2006-2-20
(#2794401@0)
-
进程工作方式为查询的时候,BY THE WAY, 我觉得你不要把太多精力放在这些牛角尖上了.基础好了,这些东西自然就懂.
-iwantcar(EnjoyStudying);
2006-2-20
(#2794486@0)
-
我没钻什么牛角尖,这是一个面试问题,我只是有感lz的“非得”而发。
-frankwoo(柳五随风);
2006-2-20
(#2794656@0)
-
仔细想想,"只能非阻塞"的方式确实很少用到.假使该进程select的数据只是用来触发一个动作,而且该进程还要频繁检测另一个状态的话,可以一试.
-mike20030405(麦客);
2006-2-20
(#2794782@0)
-
补充: 记得select()的timeout不识别0.1ms以下的设定.如果需要频繁检测状态的间隔需要小于0.1ms,可是一试.
-mike20030405(麦客);
2006-2-20
(#2794797@0)
-
笔误,是"可以一试"
-mike20030405(麦客);
2006-2-20
(#2794800@0)
-
恩,这个应该算一个。
-frankwoo(柳五随风);
2006-2-20
(#2794887@0)
-
right. I once wrote a program. A process need to detect IO and receive message from other process. And the data rate is huge. I don't want to wait at all.....
-iwantcar(EnjoyStudying);
2006-2-20
(#2795786@0)
-
0.1ms MAY BE wrong. Even in kernel, the best is 100ms. I don't write much kernel program now. This should be true till 2.4 kernel.
-iwantcar(EnjoyStudying);
2006-2-21
(#2796034@0)
-
刚查了一下资料,《linux网络编程》中解释select所用计时器的时间片是如此所说:“...因为Linux和UNIX一样,最小的时间片是100微秒,所以不管你将tv_usec设置的多小,实质上计时器的最小单位是100微秒”
-mike20030405(麦客);
2006-2-23
(#2800437@0)
-
那个作者很可能在放屁.你应该查LINUX KERNEL的书.实际测量P 3 CPU的中断响应时间是20uS worse case(在没有任何操作系统的情况下).
-iwantcar(EnjoyStudying);
2006-2-23
(#2800924@0)
-
老兄脏话比较多.
-mike20030405(麦客);
2006-2-23
(#2801365@0)
-
如果你在看中文版,就是翻译错误.
-iwantcar(EnjoyStudying);
2006-2-23
(#2800947@0)
-
恭喜你,答对了! 英文版哪里有?
-mike20030405(麦客);
2006-2-23
(#2801368@0)
-
此话怎讲?
-ccloafer(梦游加拿大);
2006-2-23
(#2801997@0)
-
“非”要用:)
-frankwoo(柳五随风);
2006-2-23
(#2802298@0)
-
when architect designs solutions based on C only. hehehe.................... engineer's question, engineer's mind set...........................
-storm9988(--);
2006-2-20
(#2795903@0)