GribApiDotNet / GribApi.NET

A powerful .NET library for reading and writing GRIB 1 and 2 files
Apache License 2.0
54 stars 28 forks source link

Not Thread Safe #54

Closed IdahoSixString closed 7 years ago

IdahoSixString commented 7 years ago

Unfortunately, due to my previous post of the callback delegate bug. This also invalidates the claim that this library is thread safe.

Actually has some fun results when degribing files across multiple threads IE different parameters showing up in different files..

0x1mason commented 7 years ago

Is this true for the 1.0 Beta?

IdahoSixString commented 7 years ago

Just brief testing it doesn't seem to be an issue on 1.0

If you don't mind me asking what was the change from 0.7... to 1.0?

0x1mason commented 7 years ago

Lots of small tweaks, one of which was fixing the callback delegate issue. Also upgraded to grib_api v1.19. I hope to get a last round of changes in and release 1.0 soon(ish).

On Jun 23, 2017 5:21 PM, "IdahoSixString" notifications@github.com wrote:

Just brief testing it doesn't seem to be an issue on 1.0

If you don't mind me asking what was the change from 0.7... to 1.0?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/0x1mason/GribApi.NET/issues/54#issuecomment-310776114, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX_-8M8x1eD9XMbYwShN1iFysJRS_WJks5sHCxzgaJpZM4NOaj2 .

IdahoSixString commented 7 years ago

So I take it each grib object gets its own instance of the degrib dll?


From: Eric Millin notifications@github.com Sent: Saturday, June 24, 2017 7:51:09 AM To: 0x1mason/GribApi.NET Cc: IdahoSixString; Author Subject: Re: [0x1mason/GribApi.NET] Not Thread Safe (#54)

Lots of small tweaks, one of which was fixing the callback delegate issue. Also upgraded to grib_api v1.19. I hope to get a last round of changes in and release 1.0 soon(ish).

On Jun 23, 2017 5:21 PM, "IdahoSixString" notifications@github.com wrote:

Just brief testing it doesn't seem to be an issue on 1.0

If you don't mind me asking what was the change from 0.7... to 1.0?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/0x1mason/GribApi.NET/issues/54#issuecomment-310776114, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX_-8M8x1eD9XMbYwShN1iFysJRS_WJks5sHCxzgaJpZM4NOaj2 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/0x1mason/GribApi.NET/issues/54#issuecomment-310839746, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFGk7u0ixULsuG_cYIaCwNWVzCkkIsxkks5sHRRNgaJpZM4NOaj2.

0x1mason commented 7 years ago

@IdahoSixString I'm afraid I don't understand what you mean about the DLL. When your app loads GribApi.NET, it loads the native DLL into memory once. Most of the objects I've created correspond to structs or handles in the original library.

IdahoSixString commented 7 years ago

How are you keeping things thread safe now?


From: Eric Millin notifications@github.com Sent: Tuesday, June 27, 2017 8:52:26 PM To: 0x1mason/GribApi.NET Cc: IdahoSixString; Mention Subject: Re: [0x1mason/GribApi.NET] Not Thread Safe (#54)

@IdahoSixStringhttps://github.com/idahosixstring I'm afraid I don't understand what you mean about the DLL. When your app loads GribApi.NET, it loads the native DLL into memory once. Most of the objects I've created correspond to structs or handles in the original library.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/0x1mason/GribApi.NET/issues/54#issuecomment-311542541, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFGk7tFEtwsU9v02w2TpNrrq0Pyc-V-Xks5sIb_qgaJpZM4NOaj2.

0x1mason commented 7 years ago

When i first started working on this project, grib_api only supported Linux threads. I added suppport for OpenMP, which is a crossplatform abstraction layer for parallel processing, because MSCRT supports OpenMP mutexes. They eventually merged my patch.

All that is to say, threadsafety is mostly maintained at the native level. That said, neither grib_api nor GribApi.NET are 100% threadsafe, but almost nothing complex ever is. The problems should only be edge cases, tho.

On Jun 28, 2017 1:04 AM, "IdahoSixString" notifications@github.com wrote:

How are you keeping things thread safe now?


From: Eric Millin notifications@github.com Sent: Tuesday, June 27, 2017 8:52:26 PM To: 0x1mason/GribApi.NET Cc: IdahoSixString; Mention Subject: Re: [0x1mason/GribApi.NET] Not Thread Safe (#54)

@IdahoSixStringhttps://github.com/idahosixstring I'm afraid I don't understand what you mean about the DLL. When your app loads GribApi.NET, it loads the native DLL into memory once. Most of the objects I've created correspond to structs or handles in the original library.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ 0x1mason/GribApi.NET/issues/54#issuecomment-311542541, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ AFGk7tFEtwsU9v02w2TpNrrq0Pyc-V-Xks5sIb_qgaJpZM4NOaj2.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/0x1mason/GribApi.NET/issues/54#issuecomment-311557304, or mute the thread https://github.com/notifications/unsubscribe-auth/AEX_-x2fK5lYHpWQZLr7bfrgyD9FvY8lks5sId7XgaJpZM4NOaj2 .

0x1mason commented 7 years ago

Closing this as resolved by v1.0.0-beta. Please lmk if it's still an issue.