LKML Archive on
help / color / mirror / Atom feed
From: Willy Tarreau <>
To: Joe Barr <>
Cc: Linux Kernel mailing List <>
Subject: Re: Serial port blues
Date: Sat, 20 Jan 2007 18:36:44 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1169242654.20402.154.camel@warthawg-desktop>


On Fri, Jan 19, 2007 at 03:37:34PM -0600, Joe Barr wrote:
> I'm forwarding this post by the author of a great little program for
> digital amateur radio on Linux, because I'm curious whether or not the
> problem he is seeing can be resolved outside the kernel.

At least, I see one wrong claim and one unexplored track in his report.
The wrong claim : the serial port can only be controled by the kernel.
It is totally wrong for true serial ports. If he does not want to use
ioctl(), then he can directly program the I/O port.

The unexplored track : he talked about nice -20. He did not seem to try
playing with sched_setscheduler(). I've been using this with a few programs
to get (close to) real-time responsiveness and it gives very good results.
Not sure whether it will work for his case, though, but it's easy to try,
basically, he just has to add this to the top of his program :

#include <sched.h>
main() {
  struct sched_param sch;

  /* see man sched_setscheduler for other options */
  sch.sched_priority = 1;
  if (sched_setscheduler(getpid(), SCHED_FIFO, &sch) == -1)
    perror("failed. Got root ?");

  /* rest of the program now running with real-time prio */

Now he must be careful about avoiding busy loops in the rest of the
program, or he will have to use the reset button.

> All comments welcome on/off list.
> Thanks,
> Joe Barr

[ rest stripped ]


  reply	other threads:[~2007-01-20 17:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-19 21:37 Joe Barr
2007-01-20 17:36 ` Willy Tarreau [this message]
2007-01-21  5:54   ` Theodore Tso
2007-01-21  7:05     ` Willy Tarreau
2007-01-21 14:04       ` Johannes Stezenbach
     [not found]         ` <>
2007-01-21 14:58           ` Willy Tarreau
     [not found]             ` <>
2007-01-21 18:52               ` Theodore Tso
     [not found]                 ` <>
2007-01-21 19:30                   ` Theodore Tso
2007-01-21 18:55       ` Theodore Tso
2007-01-21  5:09 ` Stuart MacDonald
2007-01-21  7:07 ` H. Peter Anvin
2007-01-21  7:08 ` H. Peter Anvin
2007-01-21 20:44   ` H. Peter Anvin
2007-01-22 11:37 ` Alan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Serial port blues' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).