Hi,

I just released node-glpk v0.0.5
https://github.com/hgourvest/node-glpk
npm install/update glpk

As promised, now the module can also solve problems asynchronously.

So I made some internal changes to GLPK to make it possible.

The first change concern glp_intopt function, because I need to
synchronize the callback (cb_func) with the nodejs main thread.
It was not possible with the current implementation of the function.
With the new API I can leave the running thread when the callback occur,
serialize the execution context, and continue in another thread
of the nodejs thread pool.
https://github.com/hgourvest/node-glpk/commit/6871c1595912ecfd3d3ab239e592cd608cedc95b

The second change concern the global environment variable (env.h).
Storing the global variable in a TLS was useless because a problem can
run in different threads. So I added a compiler option to removed it. I
sacrificed everything related to this global variable.
https://github.com/hgourvest/node-glpk/commit/4be9fc0032714672747305f247d83fde45da795c

The last change is a new option in the iocp structure: cb_reasons
With this filter I can tell the mip solver to invoke the callback only
for certain reasons. when you only want to get intermediate results,
it is a good thing to use this option to prevent unnecessary thread
switching for others events.
https://github.com/hgourvest/node-glpk/commit/dda09b72170042f55c311d5e1d3726b00a999951

Now the next step is writing the manual.

Regards

--
Henri Gourvest


_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to