[Etherlab-users] ecrt_master_receive big latency

Richard Hacker ha at igh.de
Thu Mar 11 14:32:32 CET 2021


Dear Zhou

On 2021-03-11 12:48, zy wrote:
> Dear Mr. Hacker,
> 
> Thank you for your reply. I package the operation of creating real-time
> xenomai ethercat thread and slave configuration into a dynamic library
> and call it to start ethercat communication in my Qt GUI process. But,
I am not familiar with Xenomai, but I know that you cannot run an 
application where real time and memory allocation appears in the same 
process. Page allocation can never happen in real time, unless your 
environment preallocates enough memory that you will ever use.

Note that threads run in the same process, so it doesn't help to do the 
GUI in a separate thread. It must be another process.

The way I do it (in pdserv) is to have the real time process fork()ing 
off a GUI process, with shared memory between them to communicate. This 
is quite a difficult thing to get right, but then I can use whatever I 
need in the GUI task (memory allocation, file operations) without the 
real time task blocking.

> increases.  The xenomai page fault and the big latency of calling
> ecrt_master_receive seems occurs at the same time.
One thing I have noticed is that Intel network chipsets are not well 
behaved in real time. They tend to keep back packets. I noticed it on my 
Intel I219-V, so that might also be a cause.

Richard

> Do you mean I should create a new process in GUI and call my dynamic
> library to start the real-time ethercat thread in the new process 
> instead of
> in GUI process ?  Is my understanding correct ?
> 
> Best regards,
> Zhou Yang
> 
> 
> ------------------ 原始邮件 ------------------
> *发件人:* "Richard Hacker" <ha at igh.de>;
> *发送时间:* 2021年3月11日(星期四) 晚上6:06
> *收件人:* "etherlab-users"<etherlab-users at etherlab.org>;
> *抄送:* "zy"<zhouyoung1995 at qq.com>;
> *主题:* Re: [Etherlab-users] ecrt_master_receive big latency
> 
> Dear Zhou
> 
> On 2021-03-11 08:15, zy wrote:
>  > page fault. I alse execute “cat /proc/xenomai/stat” and find MSW of the
> Page faults and real time execution will never become friends. Running a
> user space application like Qt together with a real time thread in the
> same process almost certainly leads to problems. You need to separate it
> out into a process running your GUI and another running in real-time,
> with mlockall() and the works.
> 
> 
> Mit freundlichem Gruß
> 
> Richard Hacker
> 
> -- 
> ------------------------------------------------------------------------
> 
> Richard Hacker M.Sc.
> richard.hacker at igh.de
> Tel.: +49 201 / 36014-16
> 
> Ingenieurgemeinschaft IgH
> Gesellschaft für Ingenieurleistungen mbH
> Nordsternstraße 66
> D-45329 Essen
> 
> Amtsgericht Essen HRB 11500
> USt-Id.-Nr.: DE 174 626 722
> Geschäftsführung:
> - Dr.-Ing. Siegfried Rotthäuser
> - Dr. Sven Beermann, Prokurist
> Tel.: +49 201 / 360-14-0
> http://www.igh.de
> 
> ------------------------------------------------------------------------

Mit freundlichem Gruß

Richard Hacker

-- 
------------------------------------------------------------------------

Richard Hacker M.Sc.
richard.hacker at igh.de
Tel.: +49 201 / 36014-16

Ingenieurgemeinschaft IgH
Gesellschaft für Ingenieurleistungen mbH
Nordsternstraße 66
D-45329 Essen

Amtsgericht Essen HRB 11500
USt-Id.-Nr.: DE 174 626 722
Geschäftsführung:
- Dr.-Ing. Siegfried Rotthäuser
- Dr. Sven Beermann, Prokurist
Tel.: +49 201 / 360-14-0
http://www.igh.de

------------------------------------------------------------------------


More information about the Etherlab-users mailing list