Results 1 to 4 of 4

Thread: design question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    MA, US
    Posts
    78

    design question

    Hi,
    I'm looking to design an application in vb.net that must be able to perform parallel processing of various tasks. (I'm not interested now about tasks; all tasks should implement an basic interface that will let me work with them)
    I want to have a MDI form that will control other children forms(worker). Each child form should be able to load a task based on the interface and run it. Now, my question is how to design to have equal (or approx) processing time allocated to each worker form.
    I'm thinking to try to use remoting for the worker forms to have them loaded in separate application domains and let the os to give them cpu time. I would like to avoid threads if possible.
    If this may work, how should I design it, which should be the host component for remoting and which should be the client?

    Any comments or ideeas.

    Thank you,

    svatasoiu

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    I think you should use threads and forget about using remoting here. I think that using remoting will introduce a lot more complication.

    In any case, I think you answered the question yourself. You said you wanted a "parrallel processing" application. That is called multi-threaded in computer terms.

    In terms of equal processing, the OS will assign processing time accordingly. To ensure that user interaction (or whatever) is returned only when all processes are finished, you can monitor the status of each thread.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    MA, US
    Posts
    78
    shunt

    Thank you for the reply.
    Initially I was thinking to threads also, but 'safety' concerns make me try to explore remoting. This application will need to run 24/7 and run all kind of tasks. The reason I tried to avoid threads is that the tasks that will run may crash (I will not write all of them, and evan I'll do it, you never know) and I do not want that one crash to bring everithing down. Do you know of any way to protect the application from a crash in one thread?

    Thank you,
    svatasoiu

  4. #4
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    I cant remember the code. I did this last year, but you are able to catch any and all exceptions thrown by each thread individually. I would say, stick with threads and investigate the threads properly. A good place to start would be on MSDN and look at the Thread object directly.

    When you run code in a thread, you have to use a delegate. (You will need to understand delegates) In the delegated function, wrap the task execution in a try...catch block. This will prevent the thread from crashing your application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width