Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1837992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:25:24+00:00 2026-05-17T06:25:24+00:00

Greetings all, I want to run the code block inside the loop ,in seperate

  • 0

Greetings all,

I want to run the code block inside the loop ,in seperate OpenMP thread.
Have I defined correct OpenMP directives in the following code snippet:

#ifdef OPENMP_ENABLE
        #pragma omp parallel for
    #endif

for(int i=0;i<numOfSlices;i++){                  // Entire block inside this loop should be fun in new OpenMP thread

        int id =0;

        #ifdef OPENMP_ENABLE
               id=omp_get_thread_num();
              qDebug("------- OPENMP thread number  %d",id);
        #endif
            qDebug("      - Image Slice %d",i);

        int width=0,height=0;
        //Image Buffer
        unsigned char *buff=planeViewer->getImageBuggerOfSlice(i,height,width);

        //Trunk
        RzTrunk *rztrnk=planeViewer->getTrunkOfSlice(i);

        //If Empty trunk,add frame @TODO Hard coded
        if(rztrnk->getCurveCount()==0){
           RzCurve *crv=rztrnk->createFrameCurve(10,10,width-10,height-10);
           rztrnk->addCurve(crv);
        }

       //Covert Rinzo Trunk to Centy Trunk!
       //TODO Make sure to deallocate memory
       QImage *qimg=new QImage(buff,width,height,QImage::Format_RGB32);
       trnk_t *trnkt = convertRzTrunkToCntyTrunk(rztrnk, qimg->width(),qimg->height());


       //Convert QImage to Cnty Image format
       image_t *imgt=convertQImageToImaget(qimg);

       //This extract parts , first should detect outer border
       if(etype==EXTRACT_DEFL_INOUT){
            cnty_extract_contour(EXTRACT_DEFL_OUT, trnkt, imgt, NULL, NULL,settings2, NULL);
            trnk_make_crvs_nodes_active(trnkt);
       }

       cnty_extract_contour(etype, trnkt, imgt, NULL, NULL,settings, NULL);
       convertCntyTrunkToRzTrunk(trnkt, rztrnk);

       trnk_destruct(trnkt);
       destroyImaget(imgt);
       delete qimg;
       delete buff;    
} //end of for loop
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:25:25+00:00Added an answer on May 17, 2026 at 6:25 am

    I found the issue.the reason was that the “cnty_extract_contour()” method is not thread-safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

greetings all I have a text that may contains emails and I want to
greetings all I have a cronExpression that I want it to be started on
Greetings all. I have 2 actions: Find and Run. They can be invoked in
Greetings All; I have a text file say test.txt and I want to make
Greetings to all... I want to use fade effect with jCarouselLite qualities. Is it
Greetings all, I have a question. On my MOSS 2007 dev box, I created
Greetings all, I have a question. I am trying to build a parametrized query
Greetings On all my controllers I recycle the same code that wraps my models
Greetings all, I have a question. I have created a WPF application. So, I
greetings all i have a domain class named car and i have an object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.