help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] GPLK 4.2 Win32 Thread safe library is broken


From: Joonas Timo Taavetti Kekoni
Subject: [Help-glpk] GPLK 4.2 Win32 Thread safe library is broken
Date: Mon, 24 Nov 2003 12:39:13 +0200 (EET)

I am repeating myself... again.

The win32 thread safe library cannot be used
with java or other enviroments (all?)
with garbage colletion.

The threading style uses allocation of the
"hidden pointer" from Thread local storage.

This requires that the objects are not passed
from one thread to another.

Garbage collector is running on a separate thread,
and therefore will mess things up, even if you were
running only one thread.

I did the same on version 3 of my threading patch,
and it failed for the forementioned reasons.

You can try my ThreadTest.java to see it yourself:
http://www.hut.fi/~jkekoni/glpk-t/

---------------------------------------------------------------
The correct ways for doing this are:

1) Allocate hidder_pointer from LPX object.
Ultimately the correct way for doing this.

        I think this requires untrivial refactoring of the code,
        I did not do it as I lack deep understanding of the
        code.

2) get rid of hidden_pointer and do not collect
   statistics or keep tract of memory/fd usage.

3) Use Mutex to protect things pointed by hidden_pointer
from concurrent access. (My patches version 4 uses this.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]