On 23 December 2015 at 07:54, Thomas Martitz <notifications@github.com><br>
wrote:<br>
<br>
> Am 22.12.2015 um 22:41 schrieb elextr:<br>
> ><br>
> > Once we had the buffer copy we could spawn the plain file write or<br>
> > |g_file_set_contents| methods as separate threads.<br>
> ><br>
> ><br>
><br>
> We have that, haven't we?<br>
><br>
> I was suggested a poll() so that we don't introduce threads into geany,<br>
> however for this specific use case a fire-and-forget worker thread might<br>
> be easier to deal with.<br>
><br>
<br>
​Nah, we need the result back.  But g_task can call a callback when the job<br>
finishes.<br>
<br>
​More complex is how to handle user actions that involve the file before<br>
svaing is finished.  Examples are reload, another save, build.  This is<br>
really the place where incomplete asynchronous saving can cause problems,<br>
and its fairly complex to handle.<br>
<br>
I essentially don't think its worth it, if a user is saving on a slow or<br>
flakey filesystem, or is saving a huuuuge file then they have to accept<br>
that it will be slow, in return for the safety guarantee synchronous saving<br>
gives.<br>
<br>
<br>
> Best regards<br>
><br>
><br>
> —<br>
> Reply to this email directly or view it on GitHub<br>
> <https://github.com/geany/geany/issues/828#issuecomment-166740695>.<br>
><br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/issues/828#issuecomment-166756765">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJzCOOXN8izf2T8BQWD3Ng7mzScdeks5pScz6gaJpZM4G3UHR.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/828#issuecomment-166756765"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>