Re: Some comments about GVFS

On Wed, 2007-05-09 at 23:58 +0200, Andy Wingo wrote:
> Hello,
> On Tue, 2007-05-08 at 16:59 +0200, Alexander Larsson wrote:
> > I'm still not sure why gstreamer needs to run its own mainloop in its
> > thread though. If its async, then it should be able to use the default
> > mainloop. Is it because there is no guarantee of the default mainloop
> > running always?
> I am not certain how the mainloop got involved here. GStreamer uses
> threads so that it can use blocking read() and write() calls.
> Underneath, it's true they go through select() first on the fd + a
> control fd from a socketpair, because you need to be able to cancel a
> wait from another thread, so that you can seek, for example. Perhaps
> that is the concern?
> In any case, as long as one is able to cancel an in-progress sync
> operation from another thread, GStreamer is fine, AFAIK.

So, if you were to implement gstreamer sinks and sources for gvfs, an
api like:
gssize   g_input_stream_read         (GInputStream          *stream,
				      void                  *buffer,
				      gsize                  count,
				      GCancellable         *cancellable,
				      GError               **error);

Would be ok with you? Its a blocking call, but if you pass in a
GCancellable you can use that to cancel the call from another thread.

And you wouldn't be interesting in async (mainloop-using) i/o operations
at all?

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an impetuous small-town cat burglar on the wrong side of the law. She's a 
vivacious mutant fairy princess with a knack for trouble. They fight crime! 

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