Re: Question about inter-thread stack references

jgk@panix.com (Joe keane)
Tue, 27 Jan 2015 02:53:48 +0000 (UTC)

          From comp.compilers

Related articles
[6 earlier articles]
Re: Question about inter-thread stack references kaz@kylheku.com (Kaz Kylheku) (2015-01-18)
Re: Question about inter-thread stack references ivan@ootbcomp.com (Ivan Godard) (2015-01-18)
Re: Question about inter-thread stack references gah@ugcs.caltech.edu (glen herrmannsfeldt) (2015-01-18)
Re: Question about inter-thread stack references gah@ugcs.caltech.edu (glen herrmannsfeldt) (2015-01-18)
Re: Question about inter-thread stack references jgk@panix.com (2015-01-25)
Re: Question about inter-thread stack references kaz@kylheku.com (Kaz Kylheku) (2015-01-25)
Re: Question about inter-thread stack references jgk@panix.com (2015-01-27)
| List of all articles for this month |

From: jgk@panix.com (Joe keane)
Newsgroups: comp.compilers
Date: Tue, 27 Jan 2015 02:53:48 +0000 (UTC)
Organization: Public Access Networks Corp.
References: 15-01-015 15-01-042 15-01-043
Keywords: parallel
Posted-Date: 28 Jan 2015 21:22:53 EST

Kaz Kylheku <kaz@kylheku.com> wrote:
> message_t request, reply;
>
> init_request(&request, ... args);
>
> if (send_request(other_thread, &request, &reply) == SEND_OK) {
> /* reply object contains reply */
> }


It is more like:


        struct my_request request;
        struct my_reply reply;


        /* request is dead, reply is dead */


        put_stuff_into_request(&request, args);


        /* request is live, reply is dead */


        do_some_bullshit_with_request(&request, args);


        /* request is live, reply is dead */


        err = enqueue_request_and_reply(queue, args, &request, &reply);


        /* request is live, reply is live */


        do_some_bullshit();


        /* request is live, reply is live */


        err = dequeue_request_and_reply(queue, args, &request, &reply);


        /* request is dead, reply is live */


        do_some_bullshit_with_reply(&reply, args);


        /* request is dead, reply is live */


        get_stuff_out_of_reply(&reply, args);


        /* request is dead, reply is dead */


It is OK if both threads are in one function, but it is easy to make a
benign change that breaks things, or worse, usually works.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.