Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    private(top) doesn't make the object pointed by top private but rather the pointer itself. Each thread ends up with an uninitialised private pointer and any attempt to dereference such a pointer with -> ends up in a segmentation fault. How about you move the Vaes_cipher_top* top = new Vaes_cipher_top; statement inside the parallel loop? Some variables look like they too need the private treatment. Also, each thread executes the same while loop and the work is not distributed among the threads. Are you testing if Vaes_cipher_top is thread-safe? Commented Nov 20, 2013 at 23:18
  • Hi Hristo, Thanks for your comment again. I am not testing if Vaes_cipher_top is thread-safe, i just want to make it multithreaded. Secondly, i have coded the while loop as you see so that each thread does the same work. Once each thread produces the correct result, i shall put random number generation for key and plaintext so that each thread works on separate plaintext and key. Right now things are not working. Please see modified code above Commented Nov 21, 2013 at 2:08
  • You moved only the new statement inside the parallel region but left the definition of top outside and it is still shared. Commented Nov 21, 2013 at 7:44
  • You get scoping errors like ./sim_main.cpp:76: error: ‘top’ was not declared in this scope. See above for updated code and error messages Commented Nov 21, 2013 at 11:04
  • Hristo, just to let you know. I shall acknowledge your contribution in helping me out in the source code. Also this code will be made opensource for anyone to use. Commented Nov 21, 2013 at 11:12