Results 1 to 4 of 4

Thread: Multiple Processors

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262

    Multiple Processors

    Guys,

    Since I have moved to C# I am quickly writing bigger and better apps than I ever could using VB. One of things I am experimenting with now is having multiple threads and processes.

    I know Exchange and SQL are all multi-proc aware. If your server is running slow, you can through another processor at it and it will take advantage of it without doing anything.

    My question is, and I apologize if this is in the wrong forum, I didn't feel the general computing was the right place, how do you write the code to take advantage of a system with multiple. When you spawn a new process, does Windows handle where the process gets run? Is there a way to direct it to a certain process.

    The main reason I ask, I am writing an app to run on one of our servers that has 4 processors. I dont want to peg one of them out.

    Thanks,

    Jerel

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Yes, Windows generally takes care of this. You can control it somewhat by setting thread priorities and what not, but for the most part, Windows will handle it for you. Definately thread out long running processes. It just makes sense.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You can also call into the API (doesn't know if it's available in the .Net Framework) to set a preferred CPU for a thread. I can't see where this would be very useful though.

    Developing for multi-CPU systems means making all your code extra thread-safe. It also means that you think hard about what code could run concurrently with other code and split those into separate threads so that they actually CAN run concurrently.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    The .Net framework has some very sexy threading capability that will let you identify and eliminate potentially racing threads, dormant threads etc... Funky.

    Managed C++, yeah!
    I don't live here any more.

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