﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Delegate and Threading</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:51:40 GMT</lastBuildDate><ttl>20</ttl><item><title>Delegate and Threading</title><link>http://forum.strataframe.net/FindPost11630.aspx</link><description>I need to pass a delegate with a parameter to the thread manager, however, the threadmanager does not take a pure delegate and requires MicroFour.StrataFrame.Threading.ThreadManager.Delegate_ExecutionMethod which does not allow parameters.  Is there anyway to get around this?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
 Public Delegate Sub GetData(ByVal passedInt As Integer)&lt;br&gt;
 Dim myMethod As MicroFour.StrataFrame.Threading.ThreadManager.Delegate_ExecutionMethod&lt;br&gt;
 myMethod = AddressOf GetDataSub&lt;br&gt;
&lt;br&gt;
This obviously does not work since :&lt;br&gt;
&lt;br&gt;
Method 'Public Sub GetDataSub(passedInt As Integer)' does not have the same signature as delegate 'Delegate Sub Delegate_ExecutionMethod()'&lt;br&gt;</description><pubDate>Mon, 24 Sep 2007 20:57:07 GMT</pubDate><dc:creator>Scott Hershberger</dc:creator></item><item><title>RE: Delegate and Threading</title><link>http://forum.strataframe.net/FindPost11661.aspx</link><description>This is a topic that we cover in depth in the training class.&amp;nbsp; There is a lot of detail that surrounds threading, events, and delegates.&amp;nbsp; As for your question, you basically understand it.&amp;nbsp; You would have to create a unique background worker thread for each threaded method that you wanted to call.&amp;nbsp; Using the ThreadManager, you can fire off as many threads as you need through a single control while managing the events associated with the ThreadManager in a thread-safe manner.</description><pubDate>Mon, 24 Sep 2007 20:57:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Delegate and Threading</title><link>http://forum.strataframe.net/FindPost11658.aspx</link><description>What are the pros/cons of using threadmanager vs. backgroundworker?  Been reading up on the bgw control and seems to do a lot of what the threadmanager does but allows passing an object through RunAsync and also seems to allow updating user interface controls.  The downside I see is that if I want multiple bgw I need to drop several of these on my form where with threadmanager I can just add another thread through AddProcess.  New to this world of multi-threading so forgive my ignorance...</description><pubDate>Mon, 24 Sep 2007 16:46:31 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Delegate and Threading</title><link>http://forum.strataframe.net/FindPost11633.aspx</link><description>I didn't realize that the ThreadManager had its own delegates... thought it used ThreadStart and ParameterizedThreadStart, but looks like it doesn't...&lt;/P&gt;&lt;P&gt;So, since you can't pass a parameter, looks like your best bet is going to be to store off that value within a shared variable somewhere and then access it from the other thread.&amp;nbsp; Don't forget to use a SyncLock if you end up accessing that variable from more than one thread at the same time ;)</description><pubDate>Fri, 21 Sep 2007 13:28:14 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Delegate and Threading</title><link>http://forum.strataframe.net/FindPost11631.aspx</link><description>Sorry...messed that code up a little  ignore the delegate totally.  It's just a normal sub with an integer param</description><pubDate>Fri, 21 Sep 2007 11:19:40 GMT</pubDate><dc:creator>Scott Hershberger</dc:creator></item></channel></rss>