Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #88163
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.064 |
| X-Spam-Evidence | '*H*': 0.87; '*S*': 0.00; 'resulting': 0.04; 'line:': 0.09; 'creates': 0.14; 'question.': 0.14; 'assigns': 0.16; 'cleaned': 0.16; 'set,': 0.16; 'task.': 0.16; 'tasks,': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'print': 0.22; 'creating': 0.23; "shouldn't": 0.24; 'source': 0.25; 'references': 0.26; 'task': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'up.': 0.33; 'fri,': 0.33; 'problem.': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'explains': 0.36; 'set.': 0.36; 'should': 0.36; 'list': 0.37; 'tasks': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'deleting': 0.60; 'solve': 0.60; 'back': 0.62; 'soon': 0.63; 'kept': 0.65; 'mar': 0.68; 'nobody': 0.68; 'tasks.': 0.68; '2015': 0.84; 'around,': 0.84; 'glance': 0.84; 'task,': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=2mbwsKJj3y2OAyTqdjgmtVTyrtx9OtQY8wD8M1WT5U0=; b=wvMizmK6V3CiMqMea5ndT1lK1wQU/yxZ6rI+1jkdLhznVQvKU4r3hD7nioHWC4/dG/ 5Ag1HmASgP13DVFtsoITr0t7JHtqFAYubMh7fbtNIYNfKTcKXZqn7cfGIXglK0WR6sTN 9+cmuezGK7ij6aqk/u8bEGG9wW708WicOqskD9zLkiUO++yOpfVaa4MpE/bvJxJRph/+ uoiC8Ph+v2kSGgO8ceyeECr9xobXrtmaHzu9qC2v/O3TJF9sH/ufZT0BWggBOZL7t7UG z2w7ZaPJxRQve+kbFu3TRiNWuSJRQcBm3DlL88EI/1FFqOMITZPabGoNMvo3Q7xuPEh6 NX/A== |
| X-Received | by 10.70.21.227 with SMTP id y3mr6374843pde.101.1427465795261; Fri, 27 Mar 2015 07:16:35 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <877fu2mx7x.fsf@elektro.pacujo.net> |
| References | <mailman.237.1427445210.10327.python-list@python.org> <87d23un7k2.fsf@elektro.pacujo.net> <b1431003-3cc6-4672-83b8-f82c4677d4b4@googlegroups.com> <877fu2mx7x.fsf@elektro.pacujo.net> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Fri, 27 Mar 2015 08:15:54 -0600 |
| Subject | Re: asyncio |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.19 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.260.1427465798.10327.python-list@python.org> (permalink) |
| Lines | 23 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1427465798 news.xs4all.nl 2864 [2001:888:2000:d::a6]:53658 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:88163 |
Show key headers only | View raw
On Fri, Mar 27, 2015 at 6:38 AM, Marko Rauhamaa <marko@pacujo.net> wrote: > I don't know the answer to your question. A superficial glance at the > relevant asyncio source code (and documentation) suggests you shouldn't > be seeing what you are seeing. > > Tasks are kept in a weak set. Tasks should evaporate as soon as nobody > references them. Actually I think this explains it. In the OP's while loop, he updates his task list with the line: tasks = asyncio.Task.all_tasks(loop) This creates a strong reference to each of the returned tasks. When the loop comes back around, it calls all_tasks again, creating a second strong reference to each task, then assigns the resulting set to tasks, allowing the original set to be collected. At no point in the loop is there ever not a strong reference to each task. So if asyncio is relying on GC to prune its task set, they will never be cleaned up. To the OP: try deleting the tasks variable after you print it out. I bet this will solve your problem.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
asyncio Łukasz Ligowski <orangewarrior@gmail.com> - 2015-03-27 01:33 -0700
Re: asyncio Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 10:55 +0200
Re: asyncio orangewarrior@gmail.com - 2015-03-27 02:32 -0700
Re: asyncio Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 14:38 +0200
Re: asyncio Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-27 08:15 -0600
Re: asyncio Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 17:44 +0200
Re: asyncio Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 17:52 +0200
Re: asyncio orangewarrior@gmail.com - 2015-03-27 16:27 -0700
csiph-web