Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. multithreading

multithreading

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neha agarwal27
    wrote on last edited by
    #1

    Hi All, Actually i have made a worker thread n i want that thread should execute 2 times simultaneosly if a button is pressed. Only the thing i knw is multi-threading will be used... How to do it? I have done very basic progmming in threads Can anybody help me in this. thanxs in advance

    K S 2 Replies Last reply
    0
    • N neha agarwal27

      Hi All, Actually i have made a worker thread n i want that thread should execute 2 times simultaneosly if a button is pressed. Only the thing i knw is multi-threading will be used... How to do it? I have done very basic progmming in threads Can anybody help me in this. thanxs in advance

      K Offline
      K Offline
      kasturi_haribabu
      wrote on last edited by
      #2

      Answer to your question : Create the two threads by calling Afx begin thread twice. Note before : 1. Both the threads should not share any data / resources. 2. if they share, its quite not possible to run them simultaneously(you can use synchronising techniques, but you will loose the "simultaneous" effect.) regards, haribabu

      1 Reply Last reply
      0
      • N neha agarwal27

        Hi All, Actually i have made a worker thread n i want that thread should execute 2 times simultaneosly if a button is pressed. Only the thing i knw is multi-threading will be used... How to do it? I have done very basic progmming in threads Can anybody help me in this. thanxs in advance

        S Offline
        S Offline
        Suresh H
        wrote on last edited by
        #3

        Hi Neha, Here is the example of multi threading { HANDLE hr; hr = CreateThread(NULL,0,(unsigned long (__stdcall *)(void *))WorkerThreadProc,param list,0,0); } //Thread function for starting 2 process. UINT WorkerThreadProc(LPVOID Param) { // Process }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups