Discussion:
[libtorrent] session::pause() and torrent_handle::save_resume_data()
sledgehammer999
2017-01-12 01:07:13 UTC
Permalink
As far as I can tell session::pause() is async.
What happens if after pause() we immediately call save_resume_data() on the
session torrents?
When we get the fastresume alert, will the fastresume contain "final" data
or is there a possibility that some changes won't be reported?
Steven Siloti
2017-01-14 02:24:23 UTC
Permalink
I think to be safe you need to wait for the torrent_paused_alert before you
call save_resume_data().

On Wed, Jan 11, 2017 at 5:07 PM, sledgehammer999 <
Post by sledgehammer999
As far as I can tell session::pause() is async.
What happens if after pause() we immediately call save_resume_data() on the
session torrents?
When we get the fastresume alert, will the fastresume contain "final" data
or is there a possibility that some changes won't be reported?
------------------------------------------------------------
------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Steven Siloti <***@gmail.com>
Arvid Norberg
2017-01-16 15:03:12 UTC
Permalink
On Jan 11, 2017, at 20:07 , sledgehammer999 <***@qbittorrent.org>
wrote:

As far as I can tell session::pause() is async.
What happens if after pause() we immediately call save_resume_data() on the
session torrents?
When we get the fastresume alert, will the fastresume contain "final" data
or is there a possibility that some changes won't be reported?


There’s only one network thread, and all calls you make into libtorrent are
queued on the same queue. Once you call pause, any subsequent call you make
will operate on the paused torrent.

There may be a small number of exceptions to this rule. pop_alerts() for
instance,
Steven Siloti
2017-01-18 02:45:50 UTC
Permalink
Post by Arvid Norberg
There’s only one network thread, and all calls you make into libtorrent are
queued on the same queue. Once you call pause, any subsequent call you make
will operate on the paused torrent.
There may be a small number of exceptions to this rule. pop_alerts() for
instance,
I had been concerned by the graceful pause mode in which the pause does
not complete immediately, but now that I look at the code again I see that
it is not relevant to an explicit pause. So yes, once the pause() call
returns it is safe to assume that the resume data is stable.
sledgehammer999
2017-01-18 14:34:54 UTC
Permalink
Thanks guys. This clears things a bit.
Post by Steven Siloti
Post by Arvid Norberg
There’s only one network thread, and all calls you make into libtorrent
are
Post by Arvid Norberg
queued on the same queue. Once you call pause, any subsequent call you
make
Post by Arvid Norberg
will operate on the paused torrent.
There may be a small number of exceptions to this rule. pop_alerts() for
instance,
I had been concerned by the graceful pause mode in which the pause does
not complete immediately, but now that I look at the code again I see that
it is not relevant to an explicit pause. So yes, once the pause() call
returns it is safe to assume that the resume data is stable.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
sledgehammer999
2017-01-18 14:39:57 UTC
Permalink
Hey, guys just to be sure. Did you notice that I talked about
session::pause() and not torrent_handle::pause()?
Are the info you gave me still valid?
Post by sledgehammer999
Thanks guys. This clears things a bit.
Post by Steven Siloti
Post by Arvid Norberg
There’s only one network thread, and all calls you make into libtorrent
are
Post by Arvid Norberg
queued on the same queue. Once you call pause, any subsequent call you
make
Post by Arvid Norberg
will operate on the paused torrent.
There may be a small number of exceptions to this rule. pop_alerts() for
instance,
I had been concerned by the graceful pause mode in which the pause does
not complete immediately, but now that I look at the code again I see that
it is not relevant to an explicit pause. So yes, once the pause() call
returns it is safe to assume that the resume data is stable.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
Steven Siloti
2017-01-18 21:27:06 UTC
Permalink
Yes, this all still applies to session::pause().

On Wed, Jan 18, 2017 at 6:39 AM, sledgehammer999 <
Post by sledgehammer999
Hey, guys just to be sure. Did you notice that I talked about
session::pause() and not torrent_handle::pause()?
Are the info you gave me still valid?
org>
Post by sledgehammer999
Thanks guys. This clears things a bit.
Post by Steven Siloti
Post by Arvid Norberg
There’s only one network thread, and all calls you make into
libtorrent
Post by sledgehammer999
Post by Steven Siloti
are
Post by Arvid Norberg
queued on the same queue. Once you call pause, any subsequent call you
make
Post by Arvid Norberg
will operate on the paused torrent.
There may be a small number of exceptions to this rule. pop_alerts()
for
Post by sledgehammer999
Post by Steven Siloti
Post by Arvid Norberg
instance,
I had been concerned by the graceful pause mode in which the pause
does
Post by sledgehammer999
Post by Steven Siloti
not complete immediately, but now that I look at the code again I see
that
Post by sledgehammer999
Post by Steven Siloti
it is not relevant to an explicit pause. So yes, once the pause() call
returns it is safe to assume that the resume data is stable.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Steven Siloti <***@gmail.com>
Loading...