From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <20200407154117.5D7D71C2@centrum.cz> <20200407171816.E0B3979D@centrum.cz> <20200408114406.6119E0D9@centrum.cz> <20200409170009.5B0DAA77@centrum.cz> <20200409201057.74CB5ED0@centrum.cz> <20200414101600.F9AA555D@centrum.cz> <20200414111059.39716137@centrum.cz> <6b8c89d1-bae0-90f5-4935-925fb0af2137@siemens.com> In-Reply-To: <6b8c89d1-bae0-90f5-4935-925fb0af2137@siemens.com> From: Richard Weinberger Date: Tue, 14 Apr 2020 12:23:42 +0200 Message-ID: Subject: Re: rt_task_unblock() POSIX alternative Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: =?UTF-8?Q?Petr_=C4=8Cervenka?= , Xenomai On Tue, Apr 14, 2020 at 12:07 PM Jan Kiszka wrote: > > On 14.04.20 11:46, Richard Weinberger wrote: > > On Tue, Apr 14, 2020 at 11:11 AM Petr =C4=8Cervenka = wrote: > >> > >>> I fear there seems to be a confusion between POSIX tasks and POSIX sk= in. > >>> Is your goal programming Xenomai realtime threads using POSIX alike A= PIs? > >>> Or are you looking for a pedant of rt_task_unblock() to unblock a > >>> POSIX task, without Xenomai realtime threads? > >>> > >>> The solution I provided is for the latter case. > >> > >> > >> > >> My original goal was to port a very complex realtime application from = Xenomai 2.6.5 Native skin to Xenomai 3.1 POSIX skin. So I made series of ex= amples, where I tried to verify porting of several designs used in the orig= . application. And rt_task_unblock() for reconfiguration of the waiting thr= eads in the orig app was one of them. > >> > >> Now I'm very curious, why the (my explicit) signals in Xenomai POSIX s= kin are not working for me as I would expect. > >> > >> > >> > >> Here is my compile command: > >> > >> g++ -fasynchronous-unwind-tables -c -g -D_DEBUG -D_GNU_SOURCE -D_REE= NTRANT -D__COBALT_WRAP__ -D__COBALT__ -I/usr/xenomai/include/cobalt -I/usr/= xenomai/include -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debu= g/GNU-Linux/main.o main.cpp > >> > >> > >> > >> Here is my link command: > >> > >> g++ -fasynchronous-unwind-tables -o dist/Debug/GNU-Linux/countertes= tapp_4 build/Debug/GNU-Linux/main.o -L/usr/xenomai/lib -Wl,-rpath,'/usr/xen= omai/lib' -Wl,--no-as-needed -Wl,@/usr/xenomai/lib/cobalt.wrappers -Wl,@/us= r/xenomai/lib/modechk.wrappers /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--w= rap=3Dmain -Wl,--dynamic-list=3D/usr/xenomai/lib/dynlist.ld -lcobalt -lmode= chk -lpthread -lrt > >> > >> > >> > >> I'm using Netbeans IDE for my attemps, but the I tried to integrate xe= no-config --posix --cflags or --ldflags result into the project settings as= much as possible. > > > > Okay. Now things get clearer. > > pthread_kill() will be wrapped to Xenomai, but you installed a signal > > handler for a Linux process. > > > > What you basically need is a function in the Xenomai POSIX skin which > > calls threadobj_unblock(). > > > > Below the working version for unblocking the RT task with non-RT signal. This interrupts the Linux syscall, yes. Does this also work when the thread blocks on the Xenomai/Cobalt side? --=20 Thanks, //richard