Home Forums C Programming C++ error when using threads

Viewing 0 reply threads
  • Author
    • #2198

      I’m using the windows.h file to use pthreads and I keep getting this error:

      Illegal System DLL Relocation

      The system DLL user32.dll was relocated in memory. The application will not run properly. The relocation occurred because the DLL Dynamically Allocated Memory occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL.

      Application Error

      The instruction at "0x611885849" referenced memory at "0x0524efe4". The memory could not be "read".

      My problem is that I’m creating a program that will organize “words” using merge sort and it creates a thread for every left side of the sort

      void merge_sort( void *ind )
      pthread_t thread;
      int arrM[2] = {((int*)ind)[0], ((int*)ind)[1]};
      int low = arrM[0], high = arrM[1], iret, mid;
      int arr1[2] = {low, 0}, arr2[2] = {0, high};
      if(low < high) {
      mid = (low + high) / 2;
      arr1[1] = mid;
      arr2[0] = mid + 1;
      iret = pthread_create(&thread, NULL, (void*(*)(void*))merge_sort, (void*) arr1);
      merge_sort((void*) arr2);
      pthread_join(thread, NULL);
      merge(low, mid, high);

      I was told that the problem is with the indexing or the memory, but I don’t really understand the problem. Could anyone guide me in the right direction?

Viewing 0 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.