Search:

Type: Posts; User: rotis23

Page 1 of 15 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,847

    I think this might have been a memory violation...

    I think this might have been a memory violation issue. I was attempting to access a NULL struct later in the thread and I'm guessing this could have potentially violated memory?
  2. Replies
    9
    Views
    1,847

    Yes thanks - I can see MAX_THREADS+1 but not...

    Yes thanks - I can see MAX_THREADS+1 but not num_threads < 0.
  3. Replies
    9
    Views
    1,847

    Something very weird going on here...I've seen...

    Something very weird going on here...I've seen the debug printf line output MAX_NUM_THREADS+1 !

    How is that possible? Either I've implemented the mutexes wrong or they're not working properly.
  4. Replies
    9
    Views
    1,847

    Thanks for the input. num__threads should be...

    Thanks for the input.

    num__threads should be num_threads in my code fragment.

    num_threads does not change anywhere else.

    Was thinking of doing that change - much more readable ;)

    BTW -...
  5. Replies
    4
    Views
    9,743

    What does pthread_create return?

    What does pthread_create return?
  6. Replies
    3
    Views
    7,388

    Find out where it's freezing by using gdb or...

    Find out where it's freezing by using gdb or strace and attaching to the running process using the '-p' option.
  7. Replies
    9
    Views
    1,847

    pthread_mutex problem

    Hi All,

    Consider this [multi-threaded] code fragment...



    int volatile num_threads = 0;

    snip...
  8. Replies
    34
    Views
    3,395

    alright :/

    alright :/
  9. Replies
    34
    Views
    3,395

    Thanks Kurt.

    Thanks Kurt.
  10. Replies
    34
    Views
    3,395

    Fair enough Salem but I've got a load of win32...

    Fair enough Salem but I've got a load of win32 code in my app :/

    Can I just get something really clear with reference to my previous lump of code:



    struct base
    {
    char *string;
    };
  11. Replies
    34
    Views
    3,395

    http://www.cs.toronto.edu/~heap/270F02/node31.html...

    http://www.cs.toronto.edu/~heap/270F02/node31.html

    Should be the following according to the above link:



    my_parent = (struct parent *)malloc(sizeof(struct parent));
  12. Replies
    34
    Views
    3,395

    doesn't like that either: Error E2108...

    doesn't like that either:



    Error E2108 struct.c 12: Improper use of typedef 'parent' in function main()
    Error E2109 struct.c 12: Not an allowed type in function main()
    Error E2034 struct.c...
  13. Replies
    34
    Views
    3,395

    Borland Windows compiler doesn't like a cast'less...

    Borland Windows compiler doesn't like a cast'less malloc:



    my_parent = malloc(sizeof(parent));


    fails with:
  14. Replies
    34
    Views
    3,395

    Compilation is not dependent on correct memory...

    Compilation is not dependent on correct memory allocation - that's why we see run time memory errors.
  15. Replies
    34
    Views
    3,395

    thanks Grumpy - Dave beat you to it slightly. I...

    thanks Grumpy - Dave beat you to it slightly. I don't want to copy the string just point to it.
  16. Replies
    34
    Views
    3,395

    And the correct way to allocate mem for a pointer...

    And the correct way to allocate mem for a pointer to a struct is?



    parent = (struct parent*)malloc(sizeof(struct parent*));


    Or should I be using calloc ahluka? I don't want to start the...
  17. Replies
    34
    Views
    3,395

    Yes - of course the problem was allocating space...

    Yes - of course the problem was allocating space for the parent pointer - thanks Dave.
  18. Replies
    34
    Views
    3,395

    OK - this works OK: struct base { ...

    OK - this works OK:



    struct base
    {
    char *string;
    };

    struct parent
  19. Replies
    34
    Views
    3,395

    No - because it's pointing to an existing char*...

    No - because it's pointing to an existing char* at the time of the printf. Maybe this is where I'm going wrong?
  20. Replies
    34
    Views
    3,395

    Segmentation fault on Linux.

    Segmentation fault on Linux.
  21. Replies
    5
    Views
    972

    Thanks for your help Kurt.

    Thanks for your help Kurt.
  22. Replies
    34
    Views
    3,395

    structs of structs

    Hi All,

    Sorry - this is my second nested data structure post today :)



    struct base
    {
    char *string;
    };
  23. Replies
    5
    Views
    972

    Yes - I have that correct in my other code :/ ...

    Yes - I have that correct in my other code :/

    Is the remaining code valid?
  24. Replies
    5
    Views
    972

    two dim table of char*

    Hi All,

    Can someone tell me if this is the correct way to create, reference and allocate mem for this data?



    int main()
    {
    char *char_table[2][1];
  25. Replies
    5
    Views
    4,098

    This quote from this url...

    This quote from this url seems to support my theory:



    Anyone shed any more light on this?
Results 1 to 25 of 351
Page 1 of 15 1 2 3 4