多线程应用
winform的程序,界面上有组件,实时数据组成,线程获得数据处理后更新界面上的组件状态,更新界面上实时数据,尝试把实时数据与组件状态更新到多个线程去处理,效果不是很好,有异常如下:
System.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。
在 System.Windows.Forms.UnsafeNativeMethods.SetWindowLongPtr32(HandleRef hWnd, Int32 nIndex, WndProc wndproc)
在 System.Windows.Forms.UnsafeNativeMethods.SetWindowLong(HandleRef hWnd, Int32 nIndex, WndProc wndproc)
在 System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
在 System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle)
在 System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
在 System.Windows.Forms.Control.CreateHandle()
在 System.Windows.Forms.Control.RecreateHandleCore()
在 System.Windows.Forms.PictureBox.set_BorderStyle(BorderStyle value)
在 Notenamo.NoteThreadUI.SetBorderStyle[TObject](TObject objCtrl, BorderStyle style, Dynamo winf)
在 NoteNynamo.Nynamo.pic_MouseLeave(Object sender, EventArgs e)
在 System.Windows.Forms.Control.OnMouseLeave(EventArgs e)
在 System.Windows.Forms.Control.WmMouseLeave(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
如果数据处理与组件状态更新一个线程运行状态稳定,速度上就更不上了,不知有啥好的办法不?