[Live-devel] Re: One (maybe two) little bug in Makefile.tail
Matteo Nastasi
matteo.nastasi at tvblob.com
Wed Mar 31 14:18:29 PST 2004
On Wed, Mar 31, 2004 at 03:13:17AM -0800, Ross Finlayson wrote:
> At 01:44 AM 3/31/04, you wrote:
> >Hi Ross,
> >
> >I found in Makefile.tail two stranges things:
> >1)
> >vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> >BASIC_USAGE_ENVIRONMENT_LIB =
> >$(BASIC_USAGE_ENVIRONMENT_DIR)/BasicUsageEnvironment.$(LIB_SUFFIX)
> >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >and the name of library is libBasicUsageEnvironment
> >
> >2)
> >TESTPROGS_DIR = testProgs
> >TESTPROGS_APP = $(TESTPROGS_DIR)/testServer$(EXE)
> >but testServer not exists in testProgs
>
> Thanks for the note. Yes, you're right! I've fixed this now.
;)
> >Another thing:
> >I'm working to a modular project that use multiple instances of your main
> >loop (in separated threads).
>
> Argh! I hope you've read
> <http://www.live.com/liveMedia/faq.html#threads>. If you're using the
> library from multiple threads, you *must* use a different
> "UsageEnvironment" and "TaskScheduler" object in each thread.
Yes, I read it and I use one in each thread.
> >I needs a way to fast shutdown your mainloop and your shutdown variable is
> >too slow for me.
> >
> >My solution is to use a command fd added to your main loop with:
> > env->taskScheduler().turnOnBackgroundReadHandling(shut_pipe,NULL,NULL);
> >
> >and
> > set your shutdown variable
> > write a char to shut_pipe fd.
> >
> >With this trick your component shotdown immediatly.
>
> Unfortunately I don't understand this. Once you set the 'watch variable',
> the event loop will exit the next time that the code returns to it, so
> there's no need to set up a special event handler.
little schema to explain my solution.
pilot-thread -> live-thread
In the main() I create with pipe() function two fd (We can call them
rd_fd and wr_fd).
in the live-thread I add
env->taskScheduler().turnOnBackgroundReadHandling(rd_fd,NULL,NULL);
before
env->taskScheduler().doEventLoop(stop);
with this trick when I want to fast shutdown live-thread from pilot-thread
into pilot-thread I perform:
set the watchVariable of live-thread
write(wr_fd,"w",1);
with this trick the select() return and the check of watchVariable shutdown
without delay the thread-live.
I propose you to add to live lib a similar mechanism to shutdown the component
without delay.
Best regards and thank you for your job.
Matteo Nastasi.
>
> Ross Finlayson
> LIVE.COM
> <http://www.live.com/>
>
> ps. In the future, please post questions/comments about the LIVE.COM
> Streaming Media code to the "live-devel" mailing list -
> <http://lists.live.com/mailman/listinfo/live-devel/> - so that others can
> read them also. (For one-on-one email, I generally give priority to paying
> consulting clients.)
ok, this is the last private message.
More information about the live-devel
mailing list