-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EveCrest: Threading NullreferenceExcepion EveCrest #72
Comments
Using threads like that really won't make much of a difference, and the API you are using is very old, manually creating threads. Most of the time is spent waiting for HTTP responses, which is why the whole library is designed with TAP using asynchronous calls. To take advantage of that, you should use the Async versions of all the methods. If you want to use separate threads, you should probably at least use the TASK api, which makes things a great deal better, and I've had on issues with that. Also keep in mind that performing requests through several different EveCrest objects may cause you to pass the amount of requests allowed per second. If you use async, EveCrest spawns up to 20 threads for public and 10 for authenticated crest. Another thing, you have a lot of obsolete code in your program. If you pass in the entity object instead of the entity url, you do not have to specify the type parameter for Load., and you do not have to pass in an empty parameter array, just leave it out.
|
I am however not able to reproduce this bug, however, the hardware I'm running at isn't the fastest. In any case, I would first try to use async and possibly increase the threadpoolsize and see if that solves your problem. There are separate threadpool properties for public and authenticated crest on ec.RequestHandler. |
It seems you are right and the threadpool is causing the exception, i will try running my code on different machines and report back if it really solves the error. btw. thank you for helping me :) |
Do you mind explaining how the threadpool is causing the exception? Also, On Sat, Feb 20, 2016 at 9:39 PM, hrkrx [email protected] wrote:
|
Nope my assumption was wrong. At first i thought it might causing the error because when i changed the properties it worked, but only if the debugger wa attached. Without the debugger i get the same result. To your second statement, in my experience if i dont use threads i get about 4 responses per second, with at least 5 threads i get up to 50 responses per second. In my real code i use LoadAsync but it doesnt make a difference if i use nonasync (in terms of exceptionthrowing) and why is the cache logic triggerd even if its set to false? |
I tried to boost my requestspeed with threading and ran into the following error:
This may be a bug because when i run only one thread its working and if i put enough delay into my algorithm its also working (most of the time).
The code to reproduce this error:
The text was updated successfully, but these errors were encountered: