|
From: Mark E. <ma...@mp...> - 2013-08-09 08:31:03
|
On Fri, 2013-08-09 at 03:24 +0200, Chris Frey wrote: > On Wed, Aug 07, 2013, Mark Ellis wrote: > > 1-glibdep-threads.diff > > Glib changed some threading functions in 2.32 and deprecated the old > > versions, I've written this to build with both styles depending on the > > version, since 2.32 didn't feel that old. > > Thanks Mark for these patches! I'll putter through them as I have > time. Hopefully it won't take too long to get them into the main tree. > > As I was reading through this patch, and looking at the API change, > I started wondering, wouldn't it be better if we wrapped glib's API > in our own? Somehow, I like the idea of pointers which are filled, > and freed, rather than keeping the entire sturcture around. > Pointers are opaque, and we don't need the structure > definition to work with them. > > So with that in mind, I'm not sure why glib decided to change the > way they did, but regardless, we don't have to follow in their footsteps, > and we can write our own pointer-oriented API. It might even be > cleaner in the long run. > > Compare to this patch: > http://lists.freedesktop.org/archives/gstreamer-commits/2012-March/061105.html > > What do you think? Are there any drawbacks to writing our own? > I wouldn't disagree with you on those points, most particularly why they changed the API. I have 2 vague points to add against wrapping them in our own API. I don't presume to know how glib's internal threading code works, so I can only presume there is a good reason for it, and the developers know what they're doing :) That's an assumption of course. The main one from my point of view though, just substituting in the new style was quite easy and quick to do, and also to test. Wrapping everything would take longer, with more chance of screwing something up in the short term. My main aim was to get rid of the warnings in the limited time I have for this these days. Thoughts ? Mark |