Received: by 10.14.127.13 with SMTP id c13mr84747eei.23.1286453545200; Thu, 07 Oct 2010 05:12:25 -0700 (PDT) X-BeenThere: erlang-programming@googlegroups.com Received: by 10.14.26.159 with SMTP id c31ls7287eea.4.p; Thu, 07 Oct 2010 05:12:24 -0700 (PDT) Received: by 10.14.48.5 with SMTP id u5mr89968eeb.24.1286453544691; Thu, 07 Oct 2010 05:12:24 -0700 (PDT) Received: by 10.14.48.5 with SMTP id u5mr89967eeb.24.1286453544681; Thu, 07 Oct 2010 05:12:24 -0700 (PDT) Return-Path: Received: from morgoth.cslab.ericsson.net (morgoth.cslab.ericsson.net [193.180.168.22]) by gmr-mx.google.com with SMTP id r57si2180869eeh.1.2010.10.07.05.12.24; Thu, 07 Oct 2010 05:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of erlang-questions-return-53729-erlang-programming+garchive-81772=googlegroups....@erlang.org designates 193.180.168.22 as permitted sender) client-ip=193.180.168.22; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of erlang-questions-return-53729-erlang-programming+garchive-81772=googlegroups....@erlang.org designates 193.180.168.22 as permitted sender) smtp.mail=erlang-questions-return-53729-erlang-programming+garchive-81772=googlegroups....@erlang.org; dkim=neutral (body hash did not verify) header...@gmail.com Received: (qmail 890 invoked by alias); 7 Oct 2010 12:12:02 -0000 Mailing-List: contact erlang-questions-h...@erlang.org; run by ezmlm Sender: Precedence: bulk List-Id: Erlang/OTP discussions List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Delivered-To: mailing list erlang-questi...@erlang.org Received: (qmail 26237 invoked from network); 7 Oct 2010 12:12:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=DhObyCr+v6psSM2he1H9g95LAdCgIIS3Zzhkmr1yXns=; b=dF5p0Kz0Lv7STcC0wU5RIqWfvLgq2gYeAkHqARo/10qhgO1hXe6XmpkaaHRJzzaCdC rfNkLUNfF0iq0fWJtJlmbggig1B0TCBC27OOYNjvKR8pOwvkdfL52wikr0osxXcJnprR VvhES47lMeBcxC7zeLVlXvKsSfyTsbjDcx1Fw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=P9TKld3B4tURxIi6UQFDEeMlvuFrwDAC3oMRlQb+buyMKUN5sozEeN+NBYWcKBfg/Y RcDwsI1Y21LZEjQbkliF1Rt40QXpVDa+gpXvF3h2vLeAIOWoPntym+3qcYO5UexUrwwG wYBscJ86PvFmBI/29mDmdukMPQpapcePK+6L8= Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Joel Reymont In-Reply-To: <1a8c7fff-d999-49ba-b34b-cfa9c1868...@c10g2000yqh.googlegroups.com> Date: Thu, 7 Oct 2010 20:11:54 +0800 Cc: erlang-questi...@erlang.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1a8c7fff-d999-49ba-b34b-cfa9c1868...@c10g2000yqh.googlegroups.com> To: Zvi X-Mailer: Apple Mail (2.1081) Subject: Re: [erlang-questions] What's the most efficient method to broadcast a message to multiple (100Ks) of processes? h= ttp://groups.google.com/group/erlang-programming/browse_thread/thread/1931= 368998000836/b325e869a3eea26a Basically, raise priority to high around your sending loop and then get = it back to normal right after. On Oct 7, 2010, at 8:01 PM, Zvi wrote: > Hi, >=20 > what's the most efficient method to broadcast a message to multiple > (100Ks) of processes? >=20 > The most naive way is: >=20 > [ Pid ! Msg || Pid<-Pids ]. >=20 > less naive method: >=20 > [ spawn(fun() -> [Pid ! Msg || Pid<-PidsSublist] end) || > PidsSublist <- partition(Pids, N) ]. >=20 > where partition(L,N) splits list L into N sublists. >=20 > Any ideas for better method? --- http://twitter.com/wagerlabs ________________________________________________________________ erlang-questions (at) erlang.org mailing list. See http://www.erlang.org/faq.html To unsubscribe; mailto:erlang-questions-unsubscr...@erlang.org