פיתוח אלגוריתמים

Sunday, March 11, 2012

בפוסט קודם דיברתי על מתכנתי אמבדד ופיתוח דרייברים. בסוף הפוסט הזכרתי אלגוריתמיקה כהיתרון התחרותי וההגנה הטובה ביותר מפני העתקה. אם יש לך אלגוריתם ייחודי לא צריך פטנט. הרי בכל מקרה פטנט צריך לרשום בהרבה מקומות בעולם, ויש מדינות חשובות שלא ממש יתיחסו אליו (מזרח). בנוסף חברה שאין לה משאבים אינסופיים כנראה לא תצליח להתמודד בבתי משפט מול חברות ענק על מנת להגן על הפטנטים שלה. הפתרון הוא אלגוריתם. אלגוריתם הוא בעצם תכנון קוד. לא משנה באיזו שפה הוא כתוב ולא צריך להוכיח שהמצאת משהו חדש. מה שחשוב הוא הידע איך לגרום למחשב לקחת מידע מסויים ולחלץ או לחשב מידע אחר, למשל...

סדרת הרצאות מצולמות בנושא מחשוב מקבילי בחסות אינטל

Thursday, February 23, 2012

מדובר בשישה פרקים באורכים משתנים, כולם באנגלית, שצולמו לפני מספר חודשים וישוחררו לצפיה כל מספר שבועות. הסדרה מתחילה בבסיס של מחשוב מקבילי ומסבירה למה מחשוב מקבילי ממש קל, וממשיכה דרך ארכיטקטורה ומודלים, ועד טכנולוגיות מתקדמות דוגמת AVX (יכולת DSP של X86). הוידאו הראשון יפורסם בימים הקרובים באתר של אינטל העולמית. למידע נוסף: http://software.intel.com/en-us/blogs/2012/02/23/pre-release-parallel-programming-and-architecture-video-series/ אסף

Exception by target of an invocation

Thursday, April 1, 2010

Parallel Programming means that we use invocations more often than we did before. Visual Studio 2008 debugger will bring you to the correct line if you get an exception, but if you invoke a method within your own code the debugger will show you the location in your own thread, which means the line that invoked the code that eventually threw an exception. The exception would say "Exception has been thrown by the target of an invocation.". To solve this and really find the location of your exception you can drill down into the inner-exception member of the exception or...

Verify Installation of a custom device using C#

Tuesday, March 9, 2010

Hi all, Using my WinUSB C# component, I also needed to automatically install the driver if it is not already installed. The INF file defines a new device class by its GUID. This means that the class does not exist on the machine if the device is not installed. Here is the code: internal static extern bool SetupDiGetClassDescription(ref Guid ClassGuid,StringBuilder classDescription, Int32 ClassDescriptionSize, ref UInt32 RequiredSize);public static bool IsDeviceClassInstalled(string deviceClassGuid){   return (IsDeviceClassInstalled(new Guid(deviceClassGuid)));} public static bool IsDeviceClassInstalled(Guid deviceClassGuid){   StringBuilder deviceClassDescription = new StringBuilder(256);   UInt32 retLength = 0;   SetupDiGetClassDescription(ref deviceClassGuid, deviceClassDescription, deviceClassDescription.Capacity, ref retLength);   return (deviceClassDescription.Length >...
no comments

OS Support for Locks

Tuesday, February 23, 2010

I'll start with saying that locks are bad and should mostly be used by infrastructure. The operating system support for locks is mostly by allowing the system to clean up a MUTEX that was locked by a thread and the thread terminated without unlocking. I would expect some more support for example detecting that two threads are using the same lock object over and over again, for example when going over a linked list. The operating system can force the threads to run on the same core. This will actually improve performance. Here is a simple scenario: Record Func(){   Record Item;   while (!found)  ...

When to use the IsBadXxxPtr Win32 API

Sunday, January 17, 2010

This post is a follow-up for two previous posts. The first is my own called Verifying C++ Buffers which was replied with a second post by Sasha titled IsBadXxxPtr Is Really Harmful – Please Don’t Use These Functions. The first post mentioned the advantages of using IsBadXxxPtr API over verifying pointers by using ASSERT (or comparing to zero). The second post mentioned the problems with this set of API in a multi-threaded application. Just to clarify my comment here is not personal and Sasha and I are having an academic discussion which will benefit us all. Let me start by saying...

Verifying C++ Buffers

Sunday, December 27, 2009

This post is following this post: Verifying Pointers in C++ which demonstrated the problem in testing a pointer for NULL after allocation like this:char* ptr=new char;if (NULL == ptr) // fail There is another issue with verifying pointers for NULL. The value NULL is #defined as 0 (zero) which is agreed to be an invalid memory address. Testing a pointer to see if it is NULL means testing to see if the pointer is pointing to address zero or not. As we all know, when we allocate a buffer and then delete it we must zero the pointer. Verifying a pointer...
no comments

Parallel Computing Tutorial

Tuesday, December 22, 2009

With some delay I am publishing a video about parallel programming. This tutorial is loaded with advanced concepts mainly dealing with parallel software design and architecture. As some of you may know I have presented "Parallel Programming for Embedded" TechEd 2009 Europe. This is the video. There are no code samples in this presentations because there are too many languages and operating systems that it is irrelevant to show any code. Instead this presentation shows how the hardware has always been parallel and therefore it is a good source for parallel design. Windows Kernel has always been working in parallel as well,...

TechEd 2009 Europe

Thursday, November 5, 2009

Hi All, If you are coming to this year's TechEd in Europe let me know about it. You are also welcome to join my session on Friday titled "Parallel Programming for Embedded". The session covers parallel computing in general and in particular for embedded systems. The most important part is that it is using a language that infrastructure people can relate to. If you ever used DOS, Device Drivers, low level C and C++, and basic Win32 API then you should come. The session uses this to your advantage. On the other hand web developers will fins this eye opening. The hardware...