You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ich Selbst <ic...@gmx.ch> on 2002/10/17 15:43:19 UTC

interrupting operations

Hi,

is it possible to stop SubVersion commands while they 
are running? Like setting a boolean to false and the
operation would then exit without completing.
I'm asking because Clients usually do (and also should)
provide a 'Cancel' button for operations which take some
time and just kill the thread would lead to memory leaks
(already tried that). Just imagine a user accidentally specifies
to get ALL log entries instead of just the last 10 - that
could lead to a veeeery long operation when there's a slow
connection and many log entries...

kind regards

SteveKing

Re: interrupting operations

Posted by Ich Selbst <ic...@gmx.ch>.
> doing this in such a way that would work well with multithreaded clients 
> would require adding a context argument that gets passed down with each 
> call and inserting calls to a user supplied callback that checks to see 
> if it should back out in various places, or using a global 
> callback/context and inserting the calling of the callback into the 
> SVN_ERR macro (that's what mine did).
Yes, but since multithreaded clients must take care also that two
SubVersion tasks don't affect the same working copy (locked files)
it would not be too much to ask for such clients to also take care
of global callback/contexts.
I even wonder if multithreaded clients have some use...

> if people are OK with the global callback/context technique (which means 
> that multithreaded clients are required to use thread specific storage 
> inside their callback in order to support multiple cancelable svn 
> actions in separate threads), i'd be happy to dig up the patches and 
> make them work again, but i don't have the time or the energy to do it 
> the other way.
I'd apreciate that!

SteveKing

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: interrupting operations

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Ich Selbst wrote:
> Hi,
>  
> is it possible to stop SubVersion commands while they
> are running? Like setting a boolean to false and the
> operation would then exit without completing.
> I'm asking because Clients usually do (and also should)
> provide a 'Cancel' button for operations which take some
> time and just kill the thread would lead to memory leaks
> (already tried that). Just imagine a user accidentally specifies
> to get ALL log entries instead of just the last 10 - that
> could lead to a veeeery long operation when there's a slow
> connection and many log entries...

currently no.

i had a patch that provided such a facility, but there was a resounding 
lack of support for it because of questions about how well it would 
perform with multithreaded clients.  (well, some people objected to it, 
some didn't, but there didn't seem to be a majority either way so i 
didn't pursue it any further)

doing this in such a way that would work well with multithreaded clients 
would require adding a context argument that gets passed down with each 
call and inserting calls to a user supplied callback that checks to see 
if it should back out in various places, or using a global 
callback/context and inserting the calling of the callback into the 
SVN_ERR macro (that's what mine did).

if people are OK with the global callback/context technique (which means 
that multithreaded clients are required to use thread specific storage 
inside their callback in order to support multiple cancelable svn 
actions in separate threads), i'd be happy to dig up the patches and 
make them work again, but i don't have the time or the energy to do it 
the other way.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org