linux-um archives
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade_spam@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>, linux-kernel@vger.kernel.org
Cc: user-mode-linux-devel@lists.sourceforge.net, akpm@osdl.org, cw@f00f.org
Subject: Synchronization primitives in UML (was: Re: [uml-devel] Re: [patch 09/20] uml: use SIG_IGN for empty sighandler)
Date: Fri, 5 Nov 2004 20:36:55 +0100	[thread overview]
Message-ID: <200411052036.55541.blaisorblade_spam@yahoo.it> (raw)

On Friday 05 November 2004 06:48, Jeff Dike wrote:
> blaisorblade_spam@yahoo.it said:
> > I had a doubt on this, but I was not getting much feedback from you...

> Yeah, sorry.
Jeff, please read this one - I have a number of important things in it. Also, 
I'd like comments from everyone else interested.

I can understand you, so I'll try to reduce my mails to you to increase the 
signal/noise ratio.

I'll still send what needed to the list, but CC you just when requesting your 
attention (not for trivial fixlet, yes for things as this one, which smelt 
like being an hack done on purpose).

> > Also, if you reject this, I'd require a comment-only patch for it: "as
> > soon as I remember why" makes me think back to my yesterday's class,
> > when  the teacher said "put comments in your code or you'll soon
> > forget what it  does!" 8-O (yes, 1st year University student :-( ).

> The thing is, you often don't realize what's going to be mysterious until
> it actually is, and then it's too late for the comment :-)

> In this case, it wants to be bounced out
You mean it failing with EINTR, right?
> of sigprocmask when a SIGWINCH 
> arrives.
Also, why shouldn't sigprocmask be restartable with the -ERESTART* mechanism? 
Wouldn't your kludge break?

Also, a nicer way to code this could be to have an explicit sighandler setting 
a flag (to get the syscall interrupted if the signal arrives before being 
blocked) and to call sigpending() (to test if the signal arrived just after 
setting it). After the syscall, that could become SIG_IGN.

Also, (optional answer), why is this needed? A comment about such issues would 
be better than an answer email.

> In order to do so, it must have a handler registered, even if 
> it does nothing.

Ok. However, I have a general question about all this whole code: why do you 
use pipes as synchronization primitives? Did you avoid semaphores for 
portability issues, or for persistency ones? Both can be solved (with the os_ 
layer and the IPC_PRIVATE key).

This would especially help during context switching, I think. I have just a 
rough idea of what switch_pipe is for, but calling the network layer (what 
you call os_pipe() is actually socketpair(), which is very confusing) to rely 
on the semaphores / wait queues it uses seems suboptimal and ugly.

What are your ideas about this?
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

             reply	other threads:[~2004-11-05 19:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-05 19:36 Blaisorblade [this message]
2004-11-06  5:13 ` Synchronization primitives in UML (was: Re: [uml-devel] Re: [patch 09/20] uml: use SIG_IGN for empty sighandler) Jeff Dike
2004-11-09 17:44   ` Blaisorblade
2004-11-09 20:48     ` Jeff Dike
2004-11-09 19:15       ` Blaisorblade
2004-11-09 19:41         ` [uml-devel] Re: Synchronization primitives in UML Chris Friesen

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=200411052036.55541.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=cw@f00f.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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