Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Avoiding NPTL problems



On Thu, Jun 10, 2004 at 03:14:12PM +0200, Klaus Schmidinger wrote:
> Since there are apparently still massive problems with running
> VDR on an NPTL system, and I currently don't plan to set up an
> NPTL system myself and spend time debugging this, and also because
> the patches suggested by Werner Fink <werner@suse.de> in the
> "Driver or VDR Problem setting and jusageing cutmarks on Nexus 2.1"
> and Ludwig Nussel <ludwig.nussel@gmx.de> in the "[PATCH] NPTL" thread
> change a bit too much for my taste (maybe that is all necessary after
> all, but I just can't verify it myself now), I'm planning on adding a few lines
> of code to VDR/vdr.c, which check for the presence of NPTL and, in case
> it is, exit the program and tell the user to do 'export LD_ASSUME_KERNEL=2.4.1'
> before starting vdr.

Hmmm ... you may have a look into POSIX for signals and threads.
The old way as done with kernel 2.4 and prior was simply a hack
by mapping thread like behaviour into processes world.

Remember the note e.g. in `info libc' within section
``Threads and Signal Handling'':

[...]

     Recall that signal masks are set on a per-thread basis, but signal
     actions and signal handlers, as set with `sigaction', are shared
     between all threads.

and one note more. VDR uses at some places lines like

     usleep(1);  // this keeps the CPU load low

now have a look into the manual page of nanosleep, sections BUGS:

[...]

       As some  applications  require  much  more  precise  pauses
       (e.g.,  in  order  to control some time-critical hardware),
       nanosleep is also capable of short  high-precision  pauses.
       If  the  process is scheduled under a real-time policy like
       SCHED_FIFO or SCHED_RR, then pauses of up to 2 ms  will  be
       performed as busy waits with microsecond precision.

and then remember that glibc usleep(3) uses the nanosleep(2) syscall.

In other words, there is a lot of work and yes it will change a lot ;)
And the rules learned the last years just by learning by doing
with threads under linux arn't POSIX conform nad with NPTL we've
to learn ``new'' things and change programming (including my self).

       Werner

-- 
AC3 loop through sound card http://bitstreamout.sourceforge.net/
Howto http://www.vdr-portal.de/board/thread.php?threadid=1958
------------------------------------------------------------------
 "Having a smoking section in a restaurant is like having
         a  peeing section in a swimming pool." -- Edward Burr




Home | Main Index | Thread Index