Search:

Type: Posts; User: VeeDub

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    3,779

    Accessing a linked list via multiple threads

    Hello,

    I have a conceptual question regarding the use of mutexes to access a shared resource, a linked list in this instance.

    Say I have two threads that can access a linked list.

    I...
  2. Hello, Unfortunately I'm experiencing issues...

    Hello,

    Unfortunately I'm experiencing issues trying to use this function in my actual code.

    If I run in the debugger I observe

    [Inferior 1 (process 43548) exited normally]

    Sometimes when...
  3. Hello laserlight, That is actually quite...

    Hello laserlight,

    That is actually quite subtle.

    I have a feeling it is going to be a while before I'm across all these little, but important, details.

    Thanks for the explanation.
  4. Here is the "call be reference" example that I...

    Here is the "call be reference" example that I was using as a guide for my initial attempt


    #include <stdio.h>
    #include <stdlib.h>

    void Increment(int *p);

    int main()
    {
  5. Hello rstanley, Thanks for responding. I'm...

    Hello rstanley,

    Thanks for responding.

    I'm hoping that you might be able to help me understand how the variable
    source_ip_subnet is updated in the main function.

    extract_subnet is a void...
  6. Need help to understand unexpected behaviour in user function

    Hello,

    I have the following function, which is based on an earlier example (which works) where the code was executed in main.

    So now I'm trying to execute the same logic, but with the code in a...
  7. Replies
    2
    Views
    7,745

    Hello laserlight, Fixed the crash as well ...

    Hello laserlight,

    Fixed the crash as well

    Thanks!
  8. Replies
    2
    Views
    7,745

    Error - Inferior 1 exited normally

    Hello,

    I'm observing the above error when executing the program.

    Here is an example extract of the relevant code (which works)


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
  9. The change that you propose works, but I'm...

    The change that you propose works, but I'm confused as to why.

    Specifically I'm trying to understand why if malloc is not required for the
    *pcap_user_datastructure.

    Why doesn't the same...
  10. Thanks Salem for your last post. It's a pity the...

    Thanks Salem for your last post. It's a pity the forum doesn't have a "like" button so that people who are assisted by responses can acknowledge those useful responses without having to add a...
  11. Have this error /main.c|125|error:...

    Have this error


    /main.c|125|error: incompatible types when assigning to type ‘process_packet_options_record_t’ from type ‘void *’|

    Which I don't understand what the compiler is trying to tell...
  12. Hello Salem, Thanks for responding ...

    Hello Salem,

    Thanks for responding


    pthread_mutex_init(&pcap_user_data->new_activity_list.mutex,NULL);


    73|error: request for member ‘mutex’ in something not a structure or union|
  13. Hello, Well it seems that I spoke too soon,...

    Hello,

    Well it seems that I spoke too soon, when I said

    Because while conceptually it seemed straightforward at the time, some of my existing code is now broken when I try and use a nested...
  14. That is actually pretty straightforward now that...

    That is actually pretty straightforward now that you have provided the explanation.

    That's perfect, and that also explains why the man page didn't go into greater detail (although perhaps they...
  15. How to pass multiple user arguments to a callback function?

    Hello,

    My question specifically relates to: pcap_loop
    and the uchar pointer which is used to pass the user argument.

    But I think my question relates more to my understanding (or lack of) C...
  16. Replies
    7
    Views
    6,152

    Yes I am, thanks. Thought I should share the...

    Yes I am, thanks.

    Thought I should share the result since I received assistance.
  17. Replies
    7
    Views
    6,152

    #include #include #include...

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    struct record
    {
    int data;
    };
    typedef struct record record_t;
  18. Replies
    7
    Views
    6,152

    Hello hamster_nz, Thanks for the pseudo code,...

    Hello hamster_nz,

    Thanks for the pseudo code, this is very helpful.

    I think you're right reinventing the wheel is the right option in this instance.

    Cheers!

    VW
  19. Replies
    7
    Views
    6,152

    Sort a double linked list

    Hello,

    My aim is to sort a double linked list.

    My understanding is that the sort functions in the standard library sort arrays; to sort a linked list I need to provide my own function/s.
    ...
  20. Replies
    3
    Views
    5,077

    Identify the statement causing an abend

    Hello,

    Is there a way that I can configure GCC to report the line nunber when an abend occurs?

    In a recent debugging session, I was intermittently receiving an abend. Yet when I executed using...
  21. Hello Salem, Would you mind confirming that...

    Hello Salem,

    Would you mind confirming that I'm using free correctly in the rem function.

    The rem function is working correctly in terms of the list pointers. That is, after removing a record....
  22. Hello Salem, Thanks for responding! I spent...

    Hello Salem,

    Thanks for responding!

    I spent a fair bit of time trying to work this out before I posted here. Without your help this would be really heavy going.

    I have added a remove...
  23. How to access a linked list structure from multiple threads

    Hello,

    The aim is to add records to a linked list, from a function that runs that perpetually in a separate thread and have the contents of the linked_list accessible from multiple threads -...
  24. Replies
    1
    Views
    3,868

    Error with strcmp

    Hello,

    The compiler is reporting the following error

    warning: passing argument 2 of ‘strcmp’ makes pointer from integer without a cast [enabled by default]

    with this strcmp statement (line...
  25. Replies
    5
    Views
    4,777

    Hello, I've figured out a work-around. I...

    Hello,

    I've figured out a work-around.

    I was right the original malloc statement was not allocating space for the "subsidiary" structure (summary_record)

    So the work-around was to add an...
Results 1 to 25 of 48
Page 1 of 2 1 2