I have read ALOT of posts about threading and the CSLA framework and I still feel compelled to ask about my little scenerio.
First, let me say that we are not using remoting or a seperation of the DataPortal onto another physical machine whatsoever. the entire BO layer and the GUI will reside on the same machine.
I have notice a significant increase in performance with my limited testnig in simply making the Editable Collections Update method multithreaded. The very small code sample is below.
Can somebody please comment on the complication I am likely to see using this small enhancment?
(Also, can somebody please comment on how to get your code pasted from Visual Studio with single spaced lines...quite annoying)
Protected Overrides Sub DataPortal_Update()
'Loop through the deleted objects and call their Update methods
For Each obj as CallAllocationPhone In DeletedList
obj.Update()
Next
'Now clear the deleted objects from the list
DeletedList.Clear()
'Loop through the objects to add and update, calling the Update Method
For Each child As CallAllocationPhone In Me
Dim newThread As New System.Threading.Thread(AddressOf UpdateChildObject)
newThread.Start(child)
Next
End Sub
Public Shared Sub UpdateChildObject(ByVal child As Object) DirectCast(child, CallAllocationPhone).Update() End Sub
A couple quick observations:
Copyright (c) Marimer LLC