Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Dec 2006 17:43:05 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        usleepless@gmail.com
Cc:        Greg 'groggy' Lehey <grog@FreeBSD.org>, Stephen Hocking <stephen.hocking@gmail.com>, multimedia@FreeBSD.org
Subject:   Re: MythTV and PVR500 (was: Possible FreeBSD port?)
Message-ID:  <20061222014304.GB4982@funkthat.com>
In-Reply-To: <c39ec84c0612201340n5644c218ma6d427b3334f2d01@mail.gmail.com>
References:  <6300771b0612181401i72e7cc58ta08e12de8d68d4d0@mail.gmail.com> <20061218232247.GQ4364@wantadilla.lemis.com> <6300771b0612181533m6ece3f38p379c78a75912d10d@mail.gmail.com> <6300771b0612181534h3158342aw554869660fc707ea@mail.gmail.com> <20061218234041.GU4364@wantadilla.lemis.com> <c39ec84c0612190937u572ff6bco28606f54645275a5@mail.gmail.com> <20061219224005.GC4364@wantadilla.lemis.com> <c39ec84c0612191509w6a5ccf10iedb640bb8dacef1c@mail.gmail.com> <20061220000049.GF4364@wantadilla.lemis.com> <c39ec84c0612201340n5644c218ma6d427b3334f2d01@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
usleepless@gmail.com wrote this message on Wed, Dec 20, 2006 at 22:40 +0100:
> because i am still running on a 4.11 server, the mythbackend needed to
> run on 4.11. i soon discovered that mythtv had strange ipc, so i
> compiled it against linux-threads ( had to rebuild QT with
> linux-threads as well ). i remember it helped a little, but not
> enough.
> 
> i stumbled upon all the busy-wait-loops:
> 
> "
>  while(!condition)
>        usleep(50);
> "
> 
> this is probably the reason why i needed linux-threads. but there is a
> catch: linux-usleep guarantees a context-switch, while freebsd doesn't
> ( didn't ? ).
> 
> my first solution was to redefine usleep in mythcontext.h, to force a
> context-switch. this produced a working mythtv-install. later on, i
> removed all busy-wait-loops because they are just plain stupid.

Why not use sched_yield(2)?  I forget if it's in 4.x, but I'm pretty
sure just yield is in 4.x...  That will force a context switch...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061222014304.GB4982>