Today I encountered some weird behavior in .NET Framework. I had written some code like: [CODE] while (reader.Read()) { DataRow row = dtSchema.NewRow(); // The above line was throwing Out of Memory Exception for (int i = 0; i < reader.FieldCount; i++) { row[i] = reader.GetValue(i); } // Some logic which uses this row } [/CODE] Since I was not adding this row to the DataTable Rows collection, my assumption was it will not affect the memory allocation of DataTable (dtSchema). But I found that the ......
By implementing multithreading in an application we can enable it to perform multiple operations simultaneously. Do remember that multithreading can not make a single processor to process two task in a single clock cycle, but the performance can be improved by utilizing the idle time of the processor. The other major benefit of multithreading in an application is, it drastically improves the response time. Multithreading is not a suitable choice if the tasks at hand are dependent on each other. In ......