zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Multithreading support in pluggable module, but with problems
Date: Sat, 11 Feb 2017 12:39:34 -0800	[thread overview]
Message-ID: <170211123934.ZM903@torch.brasslantern.com> (raw)
In-Reply-To: <1486844071.2825373.877945608.5B8686FF@webmail.messagingengine.com>

On Feb 11, 12:14pm, Sebastian Gniazdowski wrote:
}
} I think I got code close to working state. Can consecutively spawn 32
} threads one hundred times. Have functions without queue_signals() etc.
} copied from Zsh. What is to stop conflicts are helper variables.

So, what you mean is that what stops conflicts is well-written shell
scripts that remember to check the semaphores.

} 
} > In particular you *might* need to call either movefd() or redup()
} > rather than call dup2() directly, and you should otherwise be using
} > addmodulefd() to protect the fd from exec.c:closeallelse().  Examples
} > in Src/Modules/tcp.c.
} 
} Good to know, thanks. I might reserve 32 file descriptors.

There's no reason to reserve descriptors just add them as you open them,
and close them with zclose().  Also, you shouldn't add any that aren't
actually open.

Please, take a look at the way tcp.c or even socket.c manages file
descriptors, it'll probably save you a lot of thrashing.


  reply	other threads:[~2017-02-11 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11 12:58 Sebastian Gniazdowski
2017-02-11 16:43 ` Sebastian Gniazdowski
2017-02-11 19:46 ` Bart Schaefer
2017-02-11 20:14   ` Sebastian Gniazdowski
2017-02-11 20:39     ` Bart Schaefer [this message]
2017-02-11 20:56       ` Sebastian Gniazdowski

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=170211123934.ZM903@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).