[kinovea-dev] Re: C# 3.0 in Kinovea sources

  • From: Joan <joan@xxxxxxxxxxx>
  • To: kinovea-dev@xxxxxxxxxxxxx
  • Date: Fri, 12 Aug 2011 21:10:47 +0200

Well, yes maybe you're right :-)
I think some browsers report the framework version in the user agent. I will try to reinstall Piwik or Google analytics on the web site and get some stats on visitors. If most people are on 3.5 already, there's no point staying behind!

I viewed the 4.0 framework mostly as a bridge to dynamic languages, but yes, it seems they added important classes for parallel computing. It is indeed a bit too much of a step though in my opinion, but things change fast so... As far as I understand LINQ is completely available in 3.5 (even in 2.0 with the bridge lib)... (But 4.0 has a parallel implementation)

I haven't progressed in the Direct2D code. I'm starting to think it's not the right approach. WPF is right there, designed to solve exactly the same problem. However converting Kinovea to WPF is a bit frightening for me... I've never used WPF so I don't really know how big of a task it would be.

On the other hand, I'm ready to decouple decoding from rendering in the player. Having one thread for decoding and one for rendering would give an important speed boost as you mentioned before.

I think this could be done with a blocking queue (as in the Python Queue class). - The decoding thread would constantly fill the queue and block when it's full, waiting for someone to "get" an element. - The main thread would read from the queue, and block when it's empty, waiting for someone to "put" an element. - In the normal case, the queue would have some elements and both thread would be able to work separately without waiting.
If you think of another architecture don't hesitate.
Joan.



Le 12/08/2011 05:55, Hugh a e'crit :

Would it not be better to simply move it all forwards to 3/3.5/4? I know the dependencies would have to be updated to use newer versions, but Vista comes with 3, Windows 7 comes with 3.5.

3.5 has some performance boosts, but the native LINQ technology is only in .net 4, which maybe is too much of a step? This would require most systems to download an update (but this is pushed through by windows update anyway).

Have you done any changes with the direct draw version? I was unfortunately in an accident and ended up in hospital for a little while. So I have not had time to check. I did try Kinovea on a new system and realised it was not using anywhere near the performance ability of any core.

*From:*kinovea-dev-bounce@xxxxxxxxxxxxx [mailto:kinovea-dev-bounce@xxxxxxxxxxxxx] *On Behalf Of *Joan
*Sent:* Friday, 12 August 2011 7:36 AM
*To:* kinovea-dev@xxxxxxxxxxxxx
*Subject:* [kinovea-dev] C# 3.0 in Kinovea sources

For quite a few versions now, the project is compiled with the C# 3.0 compiler, while still targeting the framework 2.0. I don't think there was any part of the code that actually used C# 3.0 features though. It's always a bit hard to know which features are pure syntactic sugar that will compile directly or if assemblies from the framework 3.5 will be needed.

I have just added LINQBridge <http://code.google.com/p/linqbridge/> as a dependency (BSD licence). It's only in sandbox code but will be comitted shortly.

This small assembly (60KB) basically allows us to use the features of C# 3.0, like extensions methods, the Action<> and Func<> delegates signature, LINQ queries, λ expressions, etc. (still targeting .NET 2.0)

It just struck me as odd that Kinovea was a pet project to experiment new stuff and technologies, and that it was stuck in a 2005 language ! (The move to Mercurial DVCS follows the same logic)
joan.

PS: I'm using both SharpDevelop 4.0 and VC# Express 2008 as IDE.


Other related posts: