Go to advanced search

by dsyleixa123
Mon Jun 17, 2019 7:23 pm
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

Re: how to use pthread_kill(pthread_t tid, int sig) by which sig ?

I observed a problem: acc to pthread_kill man (3) this command (sending SIGKILL) appears to kill my entire program, not just the stallig thread - is that true? in case yes: what shall I do instead, by which command, to kill just the hung-up stalling thread (like stalling in loop_forever or while(1);...
by dsyleixa123
Sat Jun 15, 2019 6:53 am
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

Re: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

thank you, 1st, no, it didn't come over sort of harsh at all ;) and 2nd, thanks, the scheduling rules really made it more clear now. 8-) just to be sure, acc to 2. It then looks through the RR list of the current pri for a thread ready to run. If it finds one in here then that is the thread to wake ...
by dsyleixa123
Fri Jun 14, 2019 9:01 am
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

Re: how to use pthread_kill(pthread_t tid, int sig) by which sig ?

I don't know how to create an experimental setup which simulates such an event, tbh
by dsyleixa123
Fri Jun 14, 2019 8:59 am
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

Re: how to use pthread_kill(pthread_t tid, int sig) by which sig ?

I see, thank you.
tbh, I was confused because I read at stackoverflow that pthread_kill just sends a termination request to the other thread, not compellingly killing it from the timeslice in case the other thread is not able to receive anything anymore - but probably I'm wrong about that.
by dsyleixa123
Fri Jun 14, 2019 8:50 am
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

Re: how to use pthread_kill(pthread_t tid, int sig) by which sig ?

thank you,
so:
if I command from a very high prio thread
pthread_kill(tid, 9)
will that definitely cause the other (stalling) thread tid to stop unconditionally, is that correct?
by dsyleixa123
Fri Jun 14, 2019 8:42 am
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

Re: how to use pthread_kill(pthread_t tid, int sig) by which sig ?

thank you,
but out of interest:
what stands 9 for?
by dsyleixa123
Fri Jun 14, 2019 8:26 am
Forum: C/C++
Topic: how to use pthread_kill(pthread_t tid, int sig) by which sig ?
Replies: 17
Views: 316

how to use pthread_kill(pthread_t tid, int sig) by which sig ?

hello, I can't become clear about pthread_kill(pthread_t tid, int sig): tid is clear, but which value of sig is required? the man pages kill(1), (2), or (3) are absolutely ambiguous and confusing to me about that. I just want to definitely kill a blocking thread (if that once coincidentally happens)...
by dsyleixa123
Fri Jun 14, 2019 8:03 am
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

Re: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

thank you for your hints and advices! As long as the higher priority thread doesn't continuously work (e.g. it sleeps or waits on other events) then you are ok, but if your priority 50 thread sits in a loop working 100% then any threads with a priority of less than 50 won't get a look in. but IIUC, ...
by dsyleixa123
Thu Jun 13, 2019 5:58 pm
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

Re: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

PS, forgotten to ask...: if my pthreads have e.g. SCHED_RR prio=50 : which prio has a perpetual loop in main()? If a pthread by prio=50 hangs up completely, will it block then the main loop, too? And will a 2nd thread by prio=30 then also be blocked totally? int main() { // threads pthread_t thread1...
by dsyleixa123
Thu Jun 13, 2019 5:15 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

Thank you, all right, no problem, is already long forgotten 8-)
by dsyleixa123
Thu Jun 13, 2019 7:15 am
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

Re: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

thanks, yes, that is actually the crucial question I am trying to solve: For my own program I can probably define and handle different SCHED_RR prios, but which prio should I choose to be safe over kernel threads, tasks, programs, and/or daemons so that they don't temporarily take over and disturb m...
by dsyleixa123
Thu Jun 13, 2019 7:11 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

I put my former code from the loop function into a pthread by medium to high SCHED_RR priority, currently trying some different prio values to find the optimum (tried so far: prios 40 to 60).
by dsyleixa123
Wed Jun 12, 2019 11:22 pm
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

Re: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

thank you Paeryn for your reply! So IIUC, the scheduler rules (for FIFO, RR, OTHER) cannot directly be compared to each other by identical level numbers. Having read some posts here in this forum I thought SCHED_RR might be the best for my purposes as far as I understood, so I tested with prios of 4...
by dsyleixa123
Wed Jun 12, 2019 8:57 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

- solved -
by dsyleixa123
Wed Jun 12, 2019 3:56 pm
Forum: C/C++
Topic: default priorities of user programs (single thread, pthread) and of programs run by the kernel ?
Replies: 13
Views: 414

default priorities of user programs (single thread, pthread) and of programs run by the kernel ?

hello,
which are the default thread priorities of common single-thread programs (C++ sources) ,
multithreading executables using pthread (C++ sources, no arbitrary pthread priorities, just defaults)
and which priorities have programs run by the kernel?
by dsyleixa123
Tue Jun 11, 2019 12:49 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

don't expect us to do your work.
hahaha! Never heard that before - (tbh, mostly from people who personally only have vague ideas (plus unfounded suspicions) but are not able to provide actually working code though) ;)
by dsyleixa123
Tue Jun 11, 2019 8:49 am
Forum: C/C++
Topic: wiringPi undefined Reference
Replies: 28
Views: 38592

Re: wiringPi undefined Reference

I downloaded the wiringPi library directly as tar.gz file. I extracted it and then I build it. I hope i followed correct steps. Then I am trying to compile and build the simple blink program but it shows the same error of undefined reference. I am also adding the -lwiringpi in my compile line but i...
by dsyleixa123
Mon Jun 10, 2019 5:38 pm
Forum: C/C++
Topic: Counter and timer on Raspberry Pi 2?
Replies: 5
Views: 186

Re: Counter and timer on Raspberry Pi 2?

thanks, yes, I seen that already long time ago... ;)
BTW: Mr or Mrs ? ;)
by dsyleixa123
Mon Jun 10, 2019 5:02 pm
Forum: C/C++
Topic: Counter and timer on Raspberry Pi 2?
Replies: 5
Views: 186

Re: Counter and timer on Raspberry Pi 2?

hello, Mr or Mrs (?) Joan, I always have been interested in pigpio but could not find an easy access to it yet.... do you have a repo listing all your single functions and related examples ? Or perhaps something like cplusplus.com how they are listing all C/C++ functions by definitions, descriptions...
by dsyleixa123
Mon Jun 10, 2019 3:56 pm
Forum: C/C++
Topic: Counter and timer on Raspberry Pi 2?
Replies: 5
Views: 186

Re: Counter and timer on Raspberry Pi 2?

hi, have you already taken a look at wiringPi? At least for convenient timer and GPIO r/w and interrupt functions it works (mostly): http://wiringpi.com/ https://github.com/WiringPi/WiringPi/tree/master/examples (this is an unofficial repo mirror, unfortunately I don't know an "official" repo in the...
by dsyleixa123
Mon Jun 10, 2019 2:37 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

I think what you are missing is the following: my setup for my Arduino is fine, it's the same as I am using to communicate with the PC and/or with another Arduino - with the PC and/or with another Arduino it works, with the Pi it temporarily (!) does not (sometimes already after a couple of seconds ...
by dsyleixa123
Sun Jun 09, 2019 6:40 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1502

Re: code for UART comm from Pi to Arduino hangs up

that looks like what wiringSerial serialGetchar(fd) is supposed to do, but that fails, so what is the advantage? where is the timeout handling, the buffer handling, perhaps intermediate buffers if bytes don't come fast enough or by gaps, a flush, a disconnect and a resync in case it's needed? Both t...

Go to advanced search