on 2014 Nov 06 3:19 PM
Hi Everyone;
For many years (OK decades since PB 5.0) I have designed and developed many multi-threaded PowerBuilder Classic appreciations (including within the PB Server [DPB]. The following diagram outlines my successful approach to date ...
Note: The "Sub-Thread Handler" and "Real Sub-Thread" object classes are NVUO's.
Q1: Can we implement this processing model the same in PB.Net?
Q2: Even if Q1 is "yes" ... should we use the same approach in the .Net world?
Q3: If we build this in Visual Studio with C#, would the same architecture be valid?
(might still be using some PB.Net assemblies within the sub-threads as "helpers").
Many thanks in advance!
Regards ... Chris
Request clarification before answering.
First my english in writing isn't perfect.
Q1)
In general this should be possible
Q2)
Depends on what you do with you threads and how many you need
Q3)
From a high level view yes. But there'are limits. (for example thread count)
Your picture looks like that you've implemented a threadpool.
In .NET there's a solution for this:
http://msdn.microsoft.com/de-de/library/system.threading.threadpool%28v=vs.110%29.aspx
You also could take a look a this class:
http://msdn.microsoft.com/de-de/library/system.threading.tasks.task%28v=vs.110%29.aspx
Maybe this better suit your needs.
It's also possible to use callbacks (delegate keyword) with the Thread class but you also could use events (event EventHandler<T>) for communication with your threads. Which isn't a big difference.
EDIT:
When you need a huge amount of threads or often create/destroy them you should use the Task oder ThreadPool class. Because you would waste less system ressources.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.