Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C Segmentation Fault Pthreads

Name: Anonymous 2018-01-02 18:23

I'm performing square matrix multiplications. The matrices are loaded from a text file named matrices.datomly For small matrices like 5x5 sometimes it works, sometimes it doesn't, this error appears randomly, but for larger files like 100x100 it always says segmentation fault 'core' dumped. Also tried mutexes but still the same error.

Code:
/*
USAGE:
./fine <numThreads>
*/

//Standard libraries for C
#include <stdio.h>
#include <stdlib.h>


//Thread library, to create and manipulate threads
#include <pthread.h>


//Time library, to use a method to calculate execution time
#include <sys/time.h>




//pthread_mutex_t mymutex;


int matrixSize;//All matrices will be square
int NUM_THREADS; //Number of threads to be created
int nmats;//Number of pairs of matrices
int myIndex;//Index for the array of structures
struct matrix{

Name: Anonymous 2018-01-02 20:36

Can this faggot be banned already? It's literally spam, he doesn't even bother to copypaste the whole post.

Name: Anonymous 2018-01-02 21:28

>>2
Do you check every post for being a copypaste? Are you autistic?

Name: Anonymous 2018-01-02 21:51

>>3
Not him, but it's common knowledge that people copypaste crap from Reddit.

Name: Anonymous 2018-01-02 22:46

>>4
Ubuntu Forums in this case.
people
It's one idiot who thinks he's absolutely epic and hilarious.

Name: Anonymous 2018-01-03 1:47

>>5
Not OP, but what's the problem with crossposting if he didn't get his answer from the other forum?

Name: Anonymous 2018-01-03 2:14

>>6
Too low quality. If even reddit ignores it, it sure as goddamn hell does not belong here. We have enough problems.

Name: Anonymous 2018-01-03 3:08

>>7
Still better than some garbage threads about anii.

Name: Anonymous 2018-01-03 4:53

>>8
It would be if he bothered to add code tags and copy-paste the whole thing.

Name: Anonymous 2018-01-03 8:14

>>8
better my anus

Name: Anonymous 2018-01-03 8:24

>>8
It's the same level of garbage. It's as related to /prog/ramming as the anii threads. Perhaps even less since the HMA meme can be argued to be a prominent piece of our history.

Name: Anonymous 2018-01-03 8:27

>>11
argue my anus

Don't change these.
Name: Email:
Entire Thread Thread List