>> With threads you could "just" do something like
>> (run-thread (lambda ()
>> (insert-file-contents ...)
>> ...))
>> so there'd be no need to provide new asynchronous versions of things
>> like insert-file-contents.
> But you still need a mean to inform the caller, that the parallel action
> has been finished. And you need a mean to lock the buffer, while
> insert-file-contents modifies it.

Of course, but none of that is specific to insert-file-contents.
It's just part of the functionality that is generally needed for concurrency.

> I haven't read the doc in the concurrency branch, maybe this would
> answer my questions.

I don't think we'd have any locking, instead you'd have to be careful
not to touch the buffer until insert-file-contents is over.
But you could add a `busy' buffer-local variable and use it as a lock if
you feel like it.

Also to inform other code that insert-file-contents is done, you can
simply use a `done' variable which you set to t when it's done, so the
other code can check when it's over.  But a more likely way to work is
to put the "things to do when the insert-file-contents is done" in the
second "..." of my sample code.


        Stefan

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to