public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Matus Marhefka <mmarhefk@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2] containers: added mountns/mountns05.c
Date: Wed, 17 Dec 2014 15:10:28 +0100	[thread overview]
Message-ID: <20141217141028.GA17634@rei> (raw)
In-Reply-To: <1962544618.7994595.1417604885928.JavaMail.zimbra@redhat.com>

Hi!
> I used msg IPC because this test needs to synchronize 3 processes (parent
> and 2 children) and in this case at least 6 named pipes would be needed.
> So instead 6 named pipes I used only one message queue where each process
> has its own message type.

There are a few things I do not like about this solution:

* There is a static IPC key compiled in the source
  - we cannot run two instances of the test at once
  - it may interfere with the rest of the system

* There are no timeouts, if something fails the parent may end up
  waiting forever

* The code could be shorter, it takes more than three lines to just
  send the notification.

I guess that one of the problems is that the child processes need to
signal each other, which is something that the checkpoint code wasn't
written for. I think that it would be better to adapth the library so
that it fits the needs that has emerged. Or write better one that fits
all needs.

Looking at the checkpoint code, we would need a two more functions
that could be used synchronize between child processes. What about:

tst_checkpoint_signal_sibling(const char *file, const int lineno,
                              struct tst_checkpoint *checkpoint);

tst_checkopint_sibling_wait(const char *file, const int lineno,
                            struct tst_checkpoint *checkpoint);

Internally we can just reuse the tst_checkpoint_child_wait() and
tst_checkpoint_signal_parent() code (move it to separate static
functions and add a parameter with the character to be send/received).

Would that solve the problem here or are there any other obstacles?

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-12-17 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 15:07 [LTP] [PATCH] containers: added mountns/mountns05.c Matus Marhefka
2014-10-30 16:01 ` Cyril Hrubis
2014-11-05 16:49 ` [LTP] [PATCH v2] " Matus Marhefka
2014-12-02 16:42   ` Cyril Hrubis
     [not found]     ` <1962544618.7994595.1417604885928.JavaMail.zimbra@redhat.com>
2014-12-17 14:10       ` Cyril Hrubis [this message]
     [not found]         ` <5495D100.8000107@redhat.com>
2015-01-05 12:38           ` Cyril Hrubis
     [not found]         ` <939621071.8375320.1423670135099.JavaMail.zimbra@redhat.com>
2015-02-12 15:04           ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141217141028.GA17634@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mmarhefk@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox