On Feb 6, 2:42 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote:
> Hello,
>
> I could test the patch, it works really well. With it, no need to implement
> periodic polling, which is really a bad solution when on e can avoid it!
>
> Still don't know if there could be a performance impact that would require
> to have this as an optional behaviour.
>
> Rich, please do you think it is an acceptable patch ? If so, I'll then send
> my contributor agreement as needed, and open an issue.
>
> Thanks in advance,
>
> --
> Laurent
>
> 2009/2/6 Laurent PETIT <laurent.pe...@gmail.com>
>
> > Hello,
>
> > I have a problem for implementing the auto-compile feature of clojuredev
> > eclipse plugin.
>
> > My problem is that it seems that the function 'compile returns very fast to
> > the clojure dev builder, and when the builder refreshes the workspace
> > (operation needed to "see" the newly compiled classes), it's ... to early !!
>
> > I guess something could be done in clojure.lang.Compiler.writeClassFile()
> > method to avoid this situation.
> > The idea could be to make it guarantee that whenever it returns, the
> > changes are not only flushed to the OS, but also written on disk.
> > I don't know if this could have significant performance impacts, so maybe
> > it could be necessary to make this behaviour dependent on some new
> > parameter, or on a global var (something like *ensure-filesystem-sync*).
>
> > I don't have clojuredev yet to test, but the modification would be
> > something like (new end of clojure.lang.Compiler.writeClassFile()) (case
> > without conditional on the sync mechanism) :
> > FileOutputStream cfs = new FileOutputStream(cf); /// <<<<<<<< change
> > cfs type to FileOutputStream
> > try
> > {
> > cfs.write(bytecode);
> > cfs.flush(); // <<<<<<<<<<<<<<<<<<<<<<<<<<< flush cfs content
> > cfs.getFD().sync(); // <<<<<<<<<<<<<<<<<<<<<<<<< call cfs
> > FileDescriptor's sync() method
> > }
> > finally
> > {
> > cfs.close();
> > cf.lastModified();
> > }
>
> > If it is proved that it solves the above mentioned problem, would it be an
> > acceptable patch ?
> > Or, if you can think of another way to solve the general problem, please
> > tell, I'll be glad to know about it !
>
> > Regards,
I've added a call to sync in SVN 1252 - thanks for the report.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---