AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Herbert König
Hi John,

Guess it's a matter of time. Last time I looked we used punched cards, now we just close the lid of our laptop and expect it to do the right things. Give me one serious reason why yanking the power cord _should_ punish the user.

That it still does is just another incovenience. It's sooo backwards.

Cheers, 

Herbert.


-------- Ursprüngliche Nachricht --------
Von: John Pfersich
Datum:22.05.2016 07:36 (GMT+01:00)
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?




Sent from my iPad

> On May 21, 2016, at 22:07, David T. Lewis <[hidden email]> wrote:
>
>> On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
>> The issue here is that the PI - especially when used in schools - is storing everything on a micro-SD card. Being surrounded by kids is a scary thing for a computer. They don???t necessarily bother to do a nice system shutdown or even exit Scratch before yanking the power. Teachers don???t necessarily know to tell them to; lots of people doing their best with insufficient knowledge.
>
> D'oh, now I get it. I was not thinking of the case of yanking the power cord.
> I can well imagine that this might be a bit disruptive for normal process exit
> cleanups that are supposed to ensure that fflushed buffers actually make it
> to the disk-like media.
>
>> An interesting thing is that I ???remembered??? that we flush files when closing them but in fact we don???t.
>
> In a perfect world you do not need to flush a file when closing it, because
> closing it implies a flush (e.g. fclose performs an fflush). That said,
> yanking the power cord might introduce some imperfections.
>
> Dave
>
>
And I don't think that people that yank the power cord should be catered to. If you do stupid things, you should pay the consequences. A computer isn't a toaster. And teachers should convey that to their students.


Reply | Threaded
Open this post in threaded view
|

Re: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Ben Coman
On Sun, May 22, 2016 at 4:40 PM, Herbert König <[hidden email]> wrote:
> Hi John,
>
> Guess it's a matter of time. Last time I looked we used punched cards, now
> we just close the lid of our laptop and expect it to do the right things.

Closing the lid doesn't yank the power.  The battery is still there
and the system takes a few moments to cleanly put itself to sleep.

> Give me one serious reason why yanking the power cord _should_ punish the
> user.
>
> That it still does is just another incovenience. It's sooo backwards.
>
> Cheers,
>
> Herbert.
>
>
> -------- Ursprüngliche Nachricht --------
> Von: John Pfersich
> Datum:22.05.2016 07:36 (GMT+01:00)
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim
> ?
>
>
>
>
> Sent from my iPad
>> On May 21, 2016, at 22:07, David T. Lewis <[hidden email]> wrote:
>>
>>> On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
>>> The issue here is that the PI - especially when used in schools - is
>>> storing everything on a micro-SD card. Being surrounded by kids is a scary
>>> thing for a computer. They don???t necessarily bother to do a nice system
>>> shutdown or even exit Scratch before yanking the power. Teachers don???t
>>> necessarily know to tell them to; lots of people doing their best with
>>> insufficient knowledge.
>>
>> D'oh, now I get it. I was not thinking of the case of yanking the power
>> cord.
>> I can well imagine that this might be a bit disruptive for normal process
>> exit
>> cleanups that are supposed to ensure that fflushed buffers actually make
>> it
>> to the disk-like media.
>>
>>> An interesting thing is that I ???remembered??? that we flush files when
>>> closing them but in fact we don???t.
>>
>> In a perfect world you do not need to flush a file when closing it,
>> because
>> closing it implies a flush (e.g. fclose performs an fflush). That said,
>> yanking the power cord might introduce some imperfections.
>>
>> Dave
>>
>>
> And I don't think that people that yank the power cord should be catered to.
> If you do stupid things, you should pay the consequences. A computer isn't a
> toaster. And teachers should convey that to their students.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

John Pfersich-2
In reply to this post by Herbert König
On a Raspberry Pi, which is what we're talking about, yanking the power unceremoniously crashes the system. The Pi doesn't even have a power switch. You can shut down the OS before you power it down, but we're talking about a $35 computer with virtually no bells and whistles. A kid that yanks the power cord deserves what he or she gets. The rest of the OS isn't as forgiving.

I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosaves can be deadly to productivity, especially on a computer as slow as the Pi. I haven't used Squeak on a Pi, but on my MacBook, a save takes a few seconds, and I've got better things to do than stop working while the save takes place. And the save itself might leave the image in an unstable state.

Sent from my iPhone

> On May 22, 2016, at 01:40, Herbert König <[hidden email]> wrote:
>
> Hi John,
>
> Guess it's a matter of time. Last time I looked we used punched cards, now we just close the lid of our laptop and expect it to do the right things. Give me one serious reason why yanking the power cord _should_ punish the user.
>
> That it still does is just another incovenience. It's sooo backwards.
>
> Cheers,
>
> Herbert.
>
>
> -------- Ursprüngliche Nachricht --------
> Von: John Pfersich
> Datum:22.05.2016 07:36 (GMT+01:00)
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?
>
>
>
>
> Sent from my iPad
> > On May 21, 2016, at 22:07, David T. Lewis <[hidden email]> wrote:
> >
> >> On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
> >> The issue here is that the PI - especially when used in schools - is storing everything on a micro-SD card. Being surrounded by kids is a scary thing for a computer. They don???t necessarily bother to do a nice system shutdown or even exit Scratch before yanking the power. Teachers don???t necessarily know to tell them to; lots of people doing their best with insufficient knowledge.
> >
> > D'oh, now I get it. I was not thinking of the case of yanking the power cord.
> > I can well imagine that this might be a bit disruptive for normal process exit
> > cleanups that are supposed to ensure that fflushed buffers actually make it
> > to the disk-like media.
> >
> >> An interesting thing is that I ???remembered??? that we flush files when closing them but in fact we don???t.
> >
> > In a perfect world you do not need to flush a file when closing it, because
> > closing it implies a flush (e.g. fclose performs an fflush). That said,
> > yanking the power cord might introduce some imperfections.
> >
> > Dave
> >
> >
> And I don't think that people that yank the power cord should be catered to. If you do stupid things, you should pay the consequences. A computer isn't a toaster. And teachers should convey that to their students.
>

Reply | Threaded
Open this post in threaded view
|

Re: AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Ben Coman
On Mon, May 23, 2016 at 1:33 PM, John Pfersich <[hidden email]> wrote:
> On a Raspberry Pi, which is what we're talking about, yanking the power unceremoniously crashes the system. The Pi doesn't even have a power switch. You can shut down the OS before you power it down, but we're talking about a $35 computer with virtually no bells and whistles. A kid that yanks the power cord deserves what he or she gets. The rest of the OS isn't as forgiving.
>
> I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosaves can be deadly to productivity,

Since IIUC Linux's fork() is copy-on-write, maybe the VM can fork() a
process to perform the autosave.  That might help avoid an obvious
pause, however I have no clue how overall performance might be
affected by the read-only-page-faults that copy the individual pages
that the ongoing processes write to.

cheers -ben

> especially on a computer as slow as the Pi. I haven't used Squeak on a Pi, but on my MacBook, a save takes a few seconds, and I've got better things to do than stop working while the save takes place. And the save itself might leave the image in an unstable state.
>
> Sent from my iPhone
>
>> On May 22, 2016, at 01:40, Herbert König <[hidden email]> wrote:
>>
>> Hi John,
>>
>> Guess it's a matter of time. Last time I looked we used punched cards, now we just close the lid of our laptop and expect it to do the right things. Give me one serious reason why yanking the power cord _should_ punish the user.
>>
>> That it still does is just another incovenience. It's sooo backwards.
>>
>> Cheers,
>>
>> Herbert.
>>
>>
>> -------- Ursprüngliche Nachricht --------
>> Von: John Pfersich
>> Datum:22.05.2016 07:36 (GMT+01:00)
>> An: The general-purpose Squeak developers list
>> Betreff: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?
>>
>>
>>
>>
>> Sent from my iPad
>> > On May 21, 2016, at 22:07, David T. Lewis <[hidden email]> wrote:
>> >
>> >> On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
>> >> The issue here is that the PI - especially when used in schools - is storing everything on a micro-SD card. Being surrounded by kids is a scary thing for a computer. They don???t necessarily bother to do a nice system shutdown or even exit Scratch before yanking the power. Teachers don???t necessarily know to tell them to; lots of people doing their best with insufficient knowledge.
>> >
>> > D'oh, now I get it. I was not thinking of the case of yanking the power cord.
>> > I can well imagine that this might be a bit disruptive for normal process exit
>> > cleanups that are supposed to ensure that fflushed buffers actually make it
>> > to the disk-like media.
>> >
>> >> An interesting thing is that I ???remembered??? that we flush files when closing them but in fact we don???t.
>> >
>> > In a perfect world you do not need to flush a file when closing it, because
>> > closing it implies a flush (e.g. fclose performs an fflush). That said,
>> > yanking the power cord might introduce some imperfections.
>> >
>> > Dave
>> >
>> >
>> And I don't think that people that yank the power cord should be catered to. If you do stupid things, you should pay the consequences. A computer isn't a toaster. And teachers should convey that to their students.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

David T. Lewis
On Mon, May 23, 2016 at 08:06:21PM +0800, Ben Coman wrote:
> On Mon, May 23, 2016 at 1:33 PM, John Pfersich <[hidden email]> wrote:
> > On a Raspberry Pi, which is what we're talking about, yanking the power unceremoniously crashes the system. The
Pi doesn't even have a power switch. You can shut down the OS before you power it down, but we're talking about a $3
5 computer with virtually no bells and whistles. A kid that yanks the power cord deserves what he or she gets. The r
est of the OS isn't as forgiving.
> >
> > I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosa
ves can be deadly to productivity,
>
> Since IIUC Linux's fork() is copy-on-write, maybe the VM can fork() a
> process to perform the autosave.  That might help avoid an obvious
> pause, however I have no clue how overall performance might be
> affected by the read-only-page-faults that copy the individual pages
> that the ongoing processes write to.
>
> cheers -ben



Do you mean like this?

  UnixProcess class>>saveImageInBackgroundNicely
     "Save image in a background OS process with lowered scheduling priority."

     "UnixProcess saveImageInBackgroundNicely"

     ^ self saveImageInBackground: self uniqueNameForSavedImage nice: true


This has been available for over 10 years, but AFAIK nobody uses it. That
leads me to suspect that aformentioned "deadly threat to productivity"
may not really be as horrible as previously believed ;-)

Dave
 

Reply | Threaded
Open this post in threaded view
|

Re: AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Ben Coman
On Mon, May 23, 2016 at 9:35 PM, David T. Lewis <[hidden email]> wrote:

> On Mon, May 23, 2016 at 08:06:21PM +0800, Ben Coman wrote:
>> On Mon, May 23, 2016 at 1:33 PM, John Pfersich <[hidden email]> wrote:
>> > On a Raspberry Pi, which is what we're talking about, yanking the power unceremoniously crashes the system. The
> Pi doesn't even have a power switch. You can shut down the OS before you power it down, but we're talking about a $3
> 5 computer with virtually no bells and whistles. A kid that yanks the power cord deserves what he or she gets. The r
> est of the OS isn't as forgiving.
>> >
>> > I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosa
> ves can be deadly to productivity,
>>
>> Since IIUC Linux's fork() is copy-on-write, maybe the VM can fork() a
>> process to perform the autosave.  That might help avoid an obvious
>> pause, however I have no clue how overall performance might be
>> affected by the read-only-page-faults that copy the individual pages
>> that the ongoing processes write to.
>>
>> cheers -ben
>
>
>
> Do you mean like this?
>
>   UnixProcess class>>saveImageInBackgroundNicely
>      "Save image in a background OS process with lowered scheduling priority."
>
>      "UnixProcess saveImageInBackgroundNicely"
>
>      ^ self saveImageInBackground: self uniqueNameForSavedImage nice: true
>
>
> This has been available for over 10 years, but AFAIK nobody uses it. That
> leads me to suspect that aformentioned "deadly threat to productivity"
> may not really be as horrible as previously believed ;-)
>
> Dave
>
>

I didn't know of that.  But that seems essentially what I meant.
cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Adding fsync() call to the primitiveFileFlush prim ?

timrowledge
In reply to this post by John Pfersich-2

> On 22-05-2016, at 10:33 PM, John Pfersich <[hidden email]> wrote:
> I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosaves can be deadly to productivity, especially on a computer as slow as the Pi. I haven't used Squeak on a Pi, but on my MacBook, a save takes a few seconds, and I've got better things to do than stop working while the save takes place. And the save itself might leave the image in an unstable state.

You seem to have missed the rather important point that the thing to save is not the entire image but the current Scratch script that the pupil is working on. And really, no sympathy at all for 6-10 year old children? Harsh, d00d, harsh.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Proof that evolution CAN go in reverse.



Reply | Threaded
Open this post in threaded view
|

Re: AW: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?

Yoshiki Ohshima-3
In reply to this post by John Pfersich-2
And Scratch 2.0 on the web does do auto saving.  Partly it may be
because a session is typically on a faster computer but then I usually
don't see any problem with auto saving there.  So as long as it is
asynchronous and happens during the block editing time, I don't think
autosaving would degrade the productivity.

On Sun, May 22, 2016 at 10:33 PM, John Pfersich <[hidden email]> wrote:

> On a Raspberry Pi, which is what we're talking about, yanking the power unceremoniously crashes the system. The Pi doesn't even have a power switch. You can shut down the OS before you power it down, but we're talking about a $35 computer with virtually no bells and whistles. A kid that yanks the power cord deserves what he or she gets. The rest of the OS isn't as forgiving.
>
> I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosaves can be deadly to productivity, especially on a computer as slow as the Pi. I haven't used Squeak on a Pi, but on my MacBook, a save takes a few seconds, and I've got better things to do than stop working while the save takes place. And the save itself might leave the image in an unstable state.
>
> Sent from my iPhone
>
>> On May 22, 2016, at 01:40, Herbert König <[hidden email]> wrote:
>>
>> Hi John,
>>
>> Guess it's a matter of time. Last time I looked we used punched cards, now we just close the lid of our laptop and expect it to do the right things. Give me one serious reason why yanking the power cord _should_ punish the user.
>>
>> That it still does is just another incovenience. It's sooo backwards.
>>
>> Cheers,
>>
>> Herbert.
>>
>>
>> -------- Ursprüngliche Nachricht --------
>> Von: John Pfersich
>> Datum:22.05.2016 07:36 (GMT+01:00)
>> An: The general-purpose Squeak developers list
>> Betreff: Re: [squeak-dev] Adding fsync() call to the primitiveFileFlush prim ?
>>
>>
>>
>>
>> Sent from my iPad
>> > On May 21, 2016, at 22:07, David T. Lewis <[hidden email]> wrote:
>> >
>> >> On Sat, May 21, 2016 at 10:49:24AM -0700, tim Rowledge wrote:
>> >> The issue here is that the PI - especially when used in schools - is storing everything on a micro-SD card. Being surrounded by kids is a scary thing for a computer. They don???t necessarily bother to do a nice system shutdown or even exit Scratch before yanking the power. Teachers don???t necessarily know to tell them to; lots of people doing their best with insufficient knowledge.
>> >
>> > D'oh, now I get it. I was not thinking of the case of yanking the power cord.
>> > I can well imagine that this might be a bit disruptive for normal process exit
>> > cleanups that are supposed to ensure that fflushed buffers actually make it
>> > to the disk-like media.
>> >
>> >> An interesting thing is that I ???remembered??? that we flush files when closing them but in fact we don???t.
>> >
>> > In a perfect world you do not need to flush a file when closing it, because
>> > closing it implies a flush (e.g. fclose performs an fflush). That said,
>> > yanking the power cord might introduce some imperfections.
>> >
>> > Dave
>> >
>> >
>> And I don't think that people that yank the power cord should be catered to. If you do stupid things, you should pay the consequences. A computer isn't a toaster. And teachers should convey that to their students.
>>
>



--
-- Yoshiki

Reply | Threaded
Open this post in threaded view
|

Re: Adding fsync() call to the primitiveFileFlush prim ?

John Pfersich-2
In reply to this post by timrowledge

> On May 23, 2016, at 09:55, tim Rowledge <[hidden email]> wrote:
>
>
>> On 22-05-2016, at 10:33 PM, John Pfersich <[hidden email]> wrote:
>> I hope that this saving the user from himself doesn't degrade to auto saving because the pauses caused by autosaves can be deadly to productivity, especially on a computer as slow as the Pi. I haven't used Squeak on a Pi, but on my MacBook, a save takes a few seconds, and I've got better things to do than stop working while the save takes place. And the save itself might leave the image in an unstable state.
>
> You seem to have missed the rather important point that the thing to save is not the entire image but the current Scratch script that the pupil is working on. And really, no sympathy at all for 6-10 year old children? Harsh, d00d, harsh.

Well, computers are pretty harsh machines, they only do what you tell them to do, at for the past 44 years I've been using them. And they don't cater to people without a lot of patience. I've never seen a computer that takes into account people with ADHD, even mild cases.

>
> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> Useful random insult:- Proof that evolution CAN go in reverse.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Adding fsync() call to the primitiveFileFlush prim ?

timrowledge

> On 25-05-2016, at 12:22 AM, John Pfersich <[hidden email]> wrote:
>
> Well, computers are pretty harsh machines, they only do what you tell them to do, at for the past 44 years I've been using them. And they don't cater to people without a lot of patience. I've never seen a computer that takes into account people with ADHD, even mild cases.

Then it’s about time we improved on that.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- "Body by Fisher -- brains by Mattel."