Giter Club home page Giter Club logo

Comments (7)

mickeyl avatar mickeyl commented on July 29, 2024 1

Thanks for this report. The actual problem looks like a multithreading race condition – I should check whether access of the command queue is a) coordinated or b) make the command queue thread-safe.

That said, if you're checking values in a loop, you have to take care that you're not adding commands faster than they are handled, so instead of adding based on a timer it would be better to use the completion handler to schedule the next iteration.

Last but not least, there are several optimizations that I want to tackle in 2019, namely adding facilities to group multiple PID queries (in order to save bandwidth), and also something to ease repeating queries.

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

Tested this in debug and _commandQueue is between 1 and 6 after adding commands.
i dont know why it can go up to 7000.
And why it is possible to get this Error: index beyond bounds

i will try it with this solution:

if ( [_commandQueue count] > 200 )
{
    NSLog( @"cancelPendingCommands : Has more than 200" );
    [self cancelPendingCommands];
}

after: asyncProcessCommandQueue

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

created an outlet for the queue count and slow down the new requests if needed.
for me its currently ok.
Thank you for detailed answer 👍

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

Have you any idea how to fix this ?
Yesterday it was 0...4 [index 6 beyond bounds]

I start the "transmitMultipleCommands" function in the main queue but it doesn´t help.

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

This Error only happens all >50.000 readings so its hard to find the error but i think this might be help.

-(void)asyncEnqueueInternalCommand:(LTOBD2AdapterInternalCommand*)internalCommand
{
    @synchronized(self) {
        [_commandQueue addObject:internalCommand];
        [self asyncProcessCommandQueue];
    }
}

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

@synchronized(self) is not the solution.
Now i test with the serial dispatchqueue.

from ltsupportautomotive.

Skyb0rg avatar Skyb0rg commented on July 29, 2024

created pull request for the solution. #26

from ltsupportautomotive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.