On Tue, 12 May 2009, Peter W. Draper wrote:
>> 2. The pthreads calls aren't doing much. I'm not certain about this,
>> but I suspect a dummy pthreads 'implementation'
>> (or partial implementation, I think I'm only using
>> pthread{getspecific,setspecific,key_create}()) which assumed that
>> the calls were only ever from a single thread would do the trick.
>> Such a partial implementation would only be a few lines of code,
>> so you could try it out and see if the MINGW build/tests went OK.
>> If you do this you should probably put machinery in jniast.h
>> to set JNIAST_THREADS unconditionally to 0 for a MINGW build;
>> it's currently 0 in any case, but conceivably future changes
>> to AST might make it non-zero in the general case.
>>
>> Failing that, you could just implement the required pthread calls
>> on top of whatever threading MINGW does have (if any).
>
> On further reflection I think I'll need to modify JNIAST according to
> 2). The problem with the thirdparty threading library is just that, it's
> thirdparty, so we would need to distribute it and that requirement
> immediately breaks any chance for webstart (since that still doesn't
> handle external dependencies, other than standard system libraries).
Hi Mark,
I've just committed a batch of changes to JNIAST to support windows, which
after a lot of pain seems to working.
The main points are:
1 - I've removed all use of env_key. There is a JNI method that gets
you the same functionality without worrying about synchronisation
so I've changed to that.
2 - I've added a new GrfLock synchronisation object. Does the same
as AstLock, but for all the GRF calls that are outside the
AstLock managed region.
3 - There's a new HAVE_PTHREAD macro that controls the inclusion of
pthreads.h. If that's missing my "bd" implementation is used
instead (note that this switch was less trivial than it initial
seemed, in fact you were using pthreads even when AST wasn't,
hence the other changes to improve all the synchronisation
which was always being handled by pthreads).
Have a look, if you want, and see how it all looks to you.
Cheers,
Peter.
|