Hello Andrew,

I am trying to run GLPK in multi-thread way, but I discovered, that there is a problem with memory allocation/deallocation.

As I know, standard malloc and free should be thread-safe. Is there any special reason why you implement some higher "protocol" using xmalloc/xfree? I modified the library code:

void    *xmalloc(int size) {
        return calloc(1, size);
        ....
}

( xfree similarly) and my testing program works fine, but malloc takes to much processor time. There are many "xcalloc" in "simplex1" function. Is it possible to pack them all to only one xcalloc call with offsets?

char *mpo = xcalloc(sum_of_all_doubles, sizeof(double)))

...
and for example:

spx->lb = mpo + ...;

Or even better? ;-)


thanks for your help

Martin







_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to