Article View: pl.comp.lang.python
Article #27320Re: jak sensownie polaczyc watki z rekurencja?
From: Slawomir Piasecki
Date: Wed, 03 Mar 2010 10:02
Date: Wed, 03 Mar 2010 10:02
75 lines
3546 bytes
3546 bytes
no super chyba za szybko sie ucieszylem
tylko nie mam pojecia co do mnie mowicie,
powyzszy kod dziala spoko, ale jak wprowadze zamiast wyswietlania
liczb
cos bardziej skomplikowanego to juz sie zaczyna znowu klopot
funkcje f zamienilem na taka:
"def br(self, q, tab):
print "===================================
\n===================================\n\n"
print "curretn multiplicity ", tab["mlt"]
lastNr, currentMulti = int(tab["st"][0]), int(tab["mlt"])
self.points(currentMulti) ## wyszukiwanie ptk z definicji
point = self.continuation(tab) # glowne obliczenia
if len(point) > 0:
n = tab["st"][0] + 1
tav = []
for pt in range(len(point)):
nxtM = point[pt]["m"] * currentMulti # next multiplicity
if nxtM < self.multi and n < 3:
tmpName = self.newName({n: "%s-%s" % (tab["mlt"], pt)}) #
new name
orbit = self.getSelectData(point[pt]["lab"], tab["n"]) #
wybor jednej orbity
self.multiPerVar(orbit, tmpName, nxtM) # zapis orbity z
odpowiednim okresem
tav.append({"n" : tmpName, "mlt" : nxtM, "st" : [n, pt],
"c" : True, "prvN" : tab["n"]}) # dodanie do listy zadan
if nxtM > 1: # wybor metody obliczeniowej w zaleznosci od
multiplicity
tav[-1]["orb"] = False
else:
tav[-1]["orb"] = self.getSelectData(point[pt]["lab"],
tab["n"], True)
else:
print "local multiplicity is higher than global!"
for step in range(len(tav)): # dodanie do kolejki
print "add next BFpoint ", step
q.put(tav[step])
print "number of BFpoint ", len(tav)
else:
print "there is no bifurication point"
print "end of computation"
"
i teraz po wywolaniue run'a
pojawia sie moment w ktorym jeden proces sie nie chce zakonczyc
ostatni komunikat jaki mi sie wyswietla to: "end of computation"
ale nie dostaje tego komunikatu:
for i in pula:
if not i.is_alive():
print "end of process"
pula.remove(i)
a z tymi workerami to jak niby sie za to zabrac?
dzieki
p.s.
Technical Details
Message-ID:
<535d2b66-1142-4f90-b5f2-26bd907b1bd1@33g2000yqj.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!news2.glorb.com!postnews.google.com!33g2000yqj.googlegroups.com!not-for-mailReferences:
<77c00642-1b59-418a-a26a-fb99b3c32e81@g11g2000yqe.googlegroups.com> <b630f510-d64c-4eaf-8212-0f1b80d11a1f@v25g2000yqk.googlegroups.com> <4d45db34-b9c3-4939-8a81-6e6afe9b507c@f35g2000yqd.googlegroups.com> <933eed3d-fc09-4780-a96c-872031202a96@q21g2000yqm.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!news2.glorb.com!postnews.google.com!33g2000yqj.googlegroups.com!not-for-mail From: Slawomir Piasecki <piasekps@gmail.com> Newsgroups: pl.comp.lang.python Subject: Re: jak sensownie polaczyc watki z rekurencja? Date: Wed, 3 Mar 2010 02:02:58 -0800 (PST) Organization: http://groups.google.com Lines: 75 Message-ID: <535d2b66-1142-4f90-b5f2-26bd907b1bd1@33g2000yqj.googlegroups.com> References: <77c00642-1b59-418a-a26a-fb99b3c32e81@g11g2000yqe.googlegroups.com> <b630f510-d64c-4eaf-8212-0f1b80d11a1f@v25g2000yqk.googlegroups.com> <4d45db34-b9c3-4939-8a81-6e6afe9b507c@f35g2000yqd.googlegroups.com> <933eed3d-fc09-4780-a96c-872031202a96@q21g2000yqm.googlegroups.com> NNTP-Posting-Host: 155.210.85.68 Mime-Version: 1.0 X-Trace: posting.google.com 1267610659 8808 127.0.0.1 (3 Mar 2010 10:04:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 3 Mar 2010 10:04:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 33g2000yqj.googlegroups.com; posting-host=155.210.85.68; posting-account=cEvGhgoAAAAO_qlWfa_TJ-aChbR9nvzN User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100216 Fedora/3.5.8-1.fc11 Firefox/3.5.8,gzip(gfe),gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit