由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - a dummy OS question (转载)
相关主题
Process and Thread那个ibus的python process占100%cpu的fix/patch
有这种东西的开源工具吗? (转载)how to kill a zombie process?
【我很土】发现htop原来这么好用How to keep the process running (转载)
when should use multiprocess not multithread: embedded multicore linuxwhy the 4 system-config-d occupies 4 processors (100%) (转载)
如何删除如下文件。24 processes reading one file
How to force kill a process?grep 的很奇怪的现象
还有要gwave的吗?请问把memory dump到一个文件以后如何分析其内容?
问个后台运行的问题怎么看process 用多少内存?
相关话题的讨论汇总
话题: process话题: rs485话题: processes话题: threads话题: each
进入Linux版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
【 以下文字转载自 Programming 讨论区 】
发信人: wds (中原一点红:心开运就通,运通福就来), 信区: Programming
标 题: Re: a dummy OS question
发信站: BBS 未名空间站 (Sat Apr 19 10:27:23 2014, 美东)
各位大牛,容我尽力描述一下,请大家畅所欲言,非常感谢。
linux system, two rs485 ports, ~50 devices attached on these 2 ports.
~100 processes in the system from linux itself. 4 core arm.
in many sense it's like a linux desktop with our app running.
could get very busy, e.g. like the moment you open office in linux.
1. original design was like this, also tested well enough,
The main app has 10 threads on its own.
For each rs485, main process spawns off a process to monitoring all
devices on this
port. (Since this is serial bus, it's basically a for loop doing tx/rx to
each device 1 by 1. We don't have locks inside the two rs485 processes.)
so total 3 processes.
Each rs485 process doesn't talk with each other, they only talk with main
process through named pipe.
2. now after all the linux architects left, ppl asks me to change to use
threads. So only 1 process, 12 threads.
With that rs485 thread crashes without clue, no core file.
Ppl looked at code again and again and still clueless.

They don't want to go back to process, since
1. 3 processes with same name is confusing.
2. we don't know how to attach gdb to the process to debug. If only 1
process, it's easier.
3. politics
If you guys can help me with these
Q1: i think we can change process name, right ?
or create pid files for each process, i'm new to these.
Q2: if you have 3 processes with same name, how hard is it for debugging ?
Especially i want to debug the child process,
how to do this in gdb ?
can i set breakpoint in the code saying this is child, after the fork() ?
Q3: why a thread can die without core file, while main process/thread can
always generate code file ?
Q4:what can you gain if you use threads instead of processes in this case ?
(in my opinion, only gains trouble.)
Q5: named pipe through threads or processes, performance big difference ?
Many many thanks !
G*****h
发帖数: 33134
2
你现在就用了一个process
gdb 下跑,看看哪儿crash了
你这个负载的确多个process 没啥优势

【在 w*s 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: wds (中原一点红:心开运就通,运通福就来), 信区: Programming
: 标 题: Re: a dummy OS question
: 发信站: BBS 未名空间站 (Sat Apr 19 10:27:23 2014, 美东)
: 各位大牛,容我尽力描述一下,请大家畅所欲言,非常感谢。
: linux system, two rs485 ports, ~50 devices attached on these 2 ports.
: ~100 processes in the system from linux itself. 4 core arm.
: in many sense it's like a linux desktop with our app running.
: could get very busy, e.g. like the moment you open office in linux.
: 1. original design was like this, also tested well enough,

w*s
发帖数: 7227
3
要很大的系统很久才会发生,QA也在用这系统,deadline近了,用gdb实在是万不得已。
我的意见是有data sharing用thread才有意义。
现在没有什么data sharing, 用thread可能会造成thread之间data corruption,在这
情况下用thread比process有什么好处吗?
而且希望最底层的rs485信息能够尽快传送,有点像realtime,那么2个rs485 process
难道不比一个process多个thread竞争强吗?
请指教。

【在 G*****h 的大作中提到】
: 你现在就用了一个process
: gdb 下跑,看看哪儿crash了
: 你这个负载的确多个process 没啥优势

1 (共1页)
进入Linux版参与讨论
相关主题
怎么看process 用多少内存?如何删除如下文件。
什么是 Osuwybog.exe *32How to force kill a process?
How can we share system environment variable between two different process?还有要gwave的吗?
how to remove condition for a breakpoint in gdb?问个后台运行的问题
Process and Thread那个ibus的python process占100%cpu的fix/patch
有这种东西的开源工具吗? (转载)how to kill a zombie process?
【我很土】发现htop原来这么好用How to keep the process running (转载)
when should use multiprocess not multithread: embedded multicore linuxwhy the 4 system-config-d occupies 4 processors (100%) (转载)
相关话题的讨论汇总
话题: process话题: rs485话题: processes话题: threads话题: each