I have a thread pool requirement. I grabbed the threadpool articles by Xiangyang Liu and it was very instructive. However I have large long running processes that are interdependant and all the thread pools seem to be directed at independant, small, high volume processes. Also I cannot use a queue because I need to check for dependancies already in the work list and extract from other than the 1st position. So I intend to use object lists and the RemoveAt method.
Is there a reason to support a minimum number of threads in the pool. I am intending to create a new thread up to the max setting (4 only) and destroy the thread when it is compleated, is this reasonable? Some of the processes take 90 minutes.
Never underestimate the power of human stupidity
However I have large long running processes that are interdependant and all the thread pools seem to be directed at independant, small, high volume processes
Threads are a division of work, which should, ideally, be divided into small, atomic operations.
Mycroft Holmes wrote:
Some of the processes take 90 minutes.
This sounds like a candidate for an entirely seperate process, not a thread out of the pool. But, that depends on the operation. If it's a small operation that just takes a long time, then a thread may work. If it's a long step-by-step, non-repeating operation (many steps to get a job done), a seperate process may be in order.
I have a number of processes which are required to be completed. Approx 60, all are methods that call stored procs and can take from seconds to 90 minutes to complete.
I am proposing to have a "process queue" so the user can dump in as many as required and these will process in the background. This would be fairly striaght forward with 1 additional thread to service the queue. However I wanted to have multiple threads (just to overload the server ) and am looking at a thread pool.
Maybe I should use a single thread and forget the pooling bit!
Never underestimate the power of human stupidity
OK. In that case, I'd have a couple of threads running that take jobs out of a task queue and execute execute them on the SQL Server. The problem with the 90 minute job is that the connection will timeout before the stored proc gets around to returning. But, I wouldn't have this queue on the client side. I'd probably have a service component running on the SQL Server machine that manages the queue and executes jobs from it. Having your client side app executing the jobs is problematic if the client gets disconnected from the server or locks up unexpectedly. The problem then becomes how do you recover from such a situation??
I have a simple question. Is it possible to have the process be a different name than the Assembly name? Or, is it possible to rename the process when a form loads? Like say I have the assembly name is Example, when the form loads I want the process name to be Example2. Thanks for any replies.
The Process name is the executable filename and shows up under the Processes tab in TM. You cannot change this name without renaming the executable. The Window name shows up in the Applications tab. All you have to do to change this is change the Text property of your app's window.
Yea I know that, but when the solution is built with the assembly name, that's what shows up as the process name, and that's what shows up on the icon to deploy the exe. So I was just wondering if there was the ability to have the icon name different than the assembly name when it gets built.
The shortcut can have any name it want's. That name won't show up anywhere except the shortcut. The name that shows up in the Processes tab will always be the name of the .EXE file the shortcut launched.
Right, so how to I make the program have a different name on the shortcut than the process? Like when the program builds, the shortcut has a different name than the process. Like say I have a program, it's name is Example, I want the process name to be something like notepad or wordpad, but the shortcut name to be Example. I know you can manually rename the shortcut to the program but I want it to be automatically renamed.
OK. It sounds like you're using terms interchangably that are not interchangable.
A shortcut is an icon that points to an .EXE or some other executable file. The file itself has it's own filename, ending in .EXE, .BAT, .CMD, or some other extension.
For example, you have a shortcut called "Run My App" on the Desktop. This shortcut is pointing to an .EXE in the Program Files folder called MyApp.EXE. When you double-click the shortcut "Run My App", it launches MyApp.EXE. The .EXE filename is what's going to show up in the Processes tab of TaskManager. It's main window title is what's going to show up on the Applications tab. The shortcut name will not show up anywhere at all.
Yes, ok, but I'm not worried about where the shortcut name will show up, I just want it to be different than the program exe name, if that makes sense. Like you said, Run my app, and then myapp.exe, how can I make vb do this automatically. Because when I build the release, the program name, and the shortcut name are both the assembly name, which is not what I want. I want the program name to be something like notepad. But the shortcut name to be something like run my app.
Once again, you're using terms that do not mean what you're implying they do. This makes it very difficult to understand you.
Run my app, and then myapp.exe, how can I make vb do this automatically.
You don't. VB doesn't have anything to do with this. This is a function of the file system.
and the shortcut name are both the assembly name
There is no shortcut built when you compile the app, just the .EXE and supporting .DLL's. The assembly name does NOT shown up anywhere in TaskManager. The filename of the .EXE does. An assembly name is very different than a filename.
If you want the TaskManager Applications tab to show your app's window title, like "Untitled - Notepad", all you have to do is set the form's Text property in your code in an appropriate place.
OK. The first picture has nothing to do with the last two. If you rename the .EXE, the assembly name (short version) will still be "MyProject".
The bottom two pictures cannot be different - ever. The bottom picture is the .EXE filename, but Vista is showing you the name without the .EXE extension. Whatever that name is is going to be what shows un in the second picture. There is no way around that.
BTW: You don't show a shortcut anywhere in these pics.