Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2015
- 990 messages
[pharo-project/pharo-core]
by GitHub
Branch: refs/tags/50510
Home: https://github.com/pharo-project/pharo-core
Dec. 23, 2015
[pharo-project/pharo-core] 7c9d70: 50510
by GitHub
Branch: refs/heads/5.0
Home: https://github.com/pharo-project/pharo-core
Commit: 7c9d70d0de635c6d1ba7d2d6319d2c947920a88a
https://github.com/pharo-project/pharo-core/commit/7c9d70d0de635c6d1ba7d2d6…
Author: Jenkins Build Server <board(a)pharo-project.org>
Date: 2015-12-23 (Wed, 23 Dec 2015)
Changed paths:
A GTInspector-Help.package/GTInspectorHelp.class/README.md
A GTInspector-Help.package/GTInspectorHelp.class/class/accessing/bookName.st
A GTInspector-Help.package/GTInspectorHelp.class/class/accessing/pages.st
A GTInspector-Help.package/GTInspectorHelp.class/class/documentation/contact.st
A GTInspector-Help.package/GTInspectorHelp.class/class/documentation/overview.st
A GTInspector-Help.package/GTInspectorHelp.class/class/documentation/roassal.st
A GTInspector-Help.package/GTInspectorHelp.class/class/documentation/table.st
A GTInspector-Help.package/GTInspectorHelp.class/definition.st
M ImportingResource-Help.package/ImportingResourceHelp.class/class/documentation/importingIcon.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/README.md
A Metacello-Platform.package/MetacelloPharo30Platform.class/class/initialize-release/initialize.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/definition.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/defaultDirectory.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/directoryFromPath_relativeTo_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/ensureDirectoryExists_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/fileDirectoryClass.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/fileFromPath_relativeTo_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/fileHandleOn_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/parentDirectoryOf_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/readStreamOn_do_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/recursiveDelete_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/file system/tempFileFor_suffix_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/github support/downloadZipArchive_to_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/github support/extractRepositoryFrom_to_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/github%2Fbitbucket support/downloadJSON_username_pass_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/monticello/newVersionForWorkingCopy_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/pharo 2%2E0 compat/packageInfoFor_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/pharo 2%2E0 compat/registerPackageNamed_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/scripting/defaultRepositoryDescription.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/system/suspendSystemUpdateEventsDuring_.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/utilities/compiler.st
A Metacello-Platform.package/MetacelloPharo30Platform.class/instance/utilities/string_includesSubstring_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/README.md
R Metacello-Platform.package/MetacelloPharoPlatform.class/class/initialize-release/initialize.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/definition.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/attributes/defaultPlatformAttributes.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/notification/collection_do_displaying_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/notification/do_displaying_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/reflection/copyClass_as_inCategory_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/repository creation/createRepository_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/repository creation/extractTypeFromDescription_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/utilities/authorName.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/utilities/authorName_.st
R Metacello-Platform.package/MetacelloPharoPlatform.class/instance/utilities/timestamp.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/README.md
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/class/initialize-release/initialize.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/definition.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/defaultDirectory.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/directoryFromPath_relativeTo_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/ensureDirectoryExists_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/fileDirectoryClass.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/fileFromPath_relativeTo_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/fileHandleOn_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/parentDirectoryOf_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/readStreamOn_do_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/recursiveDelete_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/file system/tempFileFor_suffix_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/github support/downloadZipArchive_to_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/github support/extractRepositoryFrom_to_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/github%2Fbitbucket support/downloadJSON_username_pass_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/monticello/newVersionForWorkingCopy_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/pharo 2%2E0 compat/packageInfoFor_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/pharo 2%2E0 compat/registerPackageNamed_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/scripting/defaultRepositoryDescription.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/system/suspendSystemUpdateEventsDuring_.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/utilities/compiler.st
R Metacello-Platform.pharo30.package/MetacelloPharo30Platform.class/instance/utilities/string_includesSubstring_.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50509.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - scripts/script50510.st
R ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50509.st
A ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50510.st
M ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st
Log Message:
-----------
50510
17291 The ImportingResourceHelp has to be updated
https://pharo.fogbugz.com/f/cases/17291
17255 Need of a GTInspector help
https://pharo.fogbugz.com/f/cases/17255
17238 Clean Metacello-Platform package
https://pharo.fogbugz.com/f/cases/17238
http://files.pharo.org/image/50/50510.zip
Dec. 23, 2015
Re: [Pharo-dev] How to create a 16x16 icon from a .png file?
by Peter Uhnák
> In case you wish to improve it, it would be great to have a resize function :-)
I'll make a todo note for that.
Peter
Dec. 23, 2015
Re: [Pharo-dev] [Pharo-users] NeoJSON: parsing mapped nil fields
by Skip Lentz
Hi, thanks for replying! I can share some ideas.
> On Dec 23, 2015, at 12:09 AM, Sven Van Caekenberghe <sven(a)stfx.eu> wrote:
>
> Hi,
>
> NeoJSON does have a bit of a split personality.
Yes, this is what I noticed. Apart from this, I think itâs an awesome library, and I thank you a lot for making it.
It might be good to not make a distinction between #nextAs: and #next, and only rely on #nextAs:. Then #next might be rewritten as such:
NeoJSONReader>>next
^ self nextAs: self mapClass
Donât know if that makes sense or not. It might alleviate this split personality, as you put it.
> When you use mappings and #nextAs: it tries to map a static type structure on what is coming in. As such it is not really prepared for dynamic surprises like objects being replaced by null.
Yes, in the general case, once youâve sent #nextAs: to the reader with your value schema, youâre âstuckâ with that exact schema.
While working on the bindings for the GitHub API, there are some JSON representations which send a âtypeâ field (e.g. âtypeâ : âcommitâ).
I would like it to be possible to change the class schema to that of a subclass of the original class when detecting a combination of fields.
That is, I specify a combination of fields, and if any is present, then change the class of the current object to a subclass. By specifying combinations of fields, you don't rely on the order in which they appear in the JSON.
Maybe in this way it is possible to accomplish without giving up the nice property of NeoJSON not making intermediate structures? Sounds tough to do without turning it into a hack though..
> Do also note that the typing info is totally absent from the JSON itself, unlike STON for example. NeoJSON also tries (and succeeds) in maintaining a stream based parser that does not generate intermediate structures except your own domain models.
>
> But your request does make sense and I will think about it. It might be possible. It has been a while that I really thought about the implementation.
Alright, Iâm willing to help if needed. We can discuss in this e-mail thread.
Dec. 23, 2015
Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort
by phil@highoctane.be
On Wed, Dec 23, 2015 at 4:08 AM, Mariano Martinez Peck <
marianopeck(a)gmail.com> wrote:
>
>> >
>> >
>> > No, wait. You are getting down to the details so I want to discuss :)
>> >
>> > OSProcess does not use popen()/system() but rather fork()+exec(). That
>> means
>> > that OSProcess has implementing the very very low building blocks that
>> would
>> > allow you do to almost everything. But then it has it's complicated
>> matters.
>> > fork() + exec() cannot be implemented via FFI (this was already
>> discussed in
>> > another thread).
>>
>> Can you link that thread? I'm curious to learn this.
>
>
>
> It's a bit long discussion, but here it is:
> http://forum.world.st/ANN-Limbo-a-simple-shell-wrapper-for-NativeBoost-td46…
>
>
> Is it
>> multi-thread related? I read [a]...
>> ..."The biggest problem with using fork+exec in this way is that you
>> can't guarantee *nothing* happens between the fork call and the exec
>> call. If, for example, the JVM decides to GC or move memory around,
>> you can have a fatal crash at the JVM process level. Because of that,
>> I don't recommend using fork + exec via FFI in JRuby, even though it's
>> pretty cool. "
>>
>>
>
> Yes, exactly. Pretty much the same. Since fork() clones and both parent
> and child execute same code (smalltalk vm in our case) until you call
> exec(), for that period of time, you will have the child running too, and
> that can screw up everything.
>
>
> ..."However, since this post I've learned of the "posix_spawn" [b]
>> function available on most Unix variants. It's basically fork + exec
>> in a single function, plus most of the typical security and IO tweaks
>> you might do after forking and before execing. It's definitely my
>> recommended alternative to fork+exec for JRuby."
>>
>
>
> *WOW. This seems to be one of the most useful recommendations I got. Thank
> you VERY MUCH.*
> I was thinking myself "how could I be the only one trying to call a
> fork+exec kind of function from FFI". Here is the answer.
> BTW...I have already started coding a FFI wrapper for such a function. I
> have very basic first command working :)
>
>
>>
>> And posix_spawn also seems recommended for use with the JVM [d]
>>
>
>
> Nice.
>
>
>> and that Windows and POSIX might have similar usage, and even better
>> match Windows CreateProcess than fork/exec [f] [g] [h]
>>
>> And since with 64-bit Spur we can expect very large images, spawn may
>> be preferred over fork/exec to minimize memory usage for creating
>> application subprocesses [i]
>>
>>
> Interesting.
>
>
>>
>> Fork versus threads section of [c]
>>
>> or should we be making use of pthread_atfork [e] ?
>>
>> Overall I learnt something new about forking in a multi-threaded
>> environment
>> "When fork() is called, only the calling thread is duplicated in the
>> child process."
>>
>
> I learned that today too :)
>
>
>>
>> [a]
>> http://blog.headius.com/2009/05/fork-and-exec-on-jvm-jruby-to-rescue.html
>> [b]
>> http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
>> [d] http://skife.org/java/2012/01/24/java_daemonization_with_gressil.html
>> [c] http://repository.readscheme.org/ftp/papers/sw2002/gasbichler.pdf
>> [e]
>> http://stackoverflow.com/questions/4223553/c-does-exec-have-to-immediately-…
>> [f]
>> http://stackoverflow.com/questions/33249253/what-is-the-difference-between-…
>> [g] http://stackoverflow.com/questions/5883462/linux-createprocess
>> [h]
>> http://www.linuxquestions.org/questions/programming-9/fork-exec-versus-posi…
>> [i]
>> http://www.oracle.com/technetwork/server-storage/solaris10/subprocess-13643…
>>
>>
> Thanks for all the links, very useful!
>
>
>> > However, there is a lot of other stuff that we believe it
>> > could. So... what we wanted to see if it is possible is to have one
>> only (or
>> > very few) primitives (like forkAndExec) and all the rest via FFI. And
>> then
>> > all the features I listed in the first email of this thread.
>> >
>> > With that in mind, we believe that:
>> >
>> > 1) Before starting dealing with forkAndExec, we could try a first
>> prototype
>> > using popen(). That would allow us test a 100% FFI based approeach, deal
>> > with writing and reading from pipes via stream, face the blocking
>> issue, see
>> > a prototype on how to read async from pipes etc etc etc. If we see this
>> > works nicely, on a second step we can build another approach that
>> instead of
>> > popen() uses forkAndExec primitive.
>>
>> Is popen() being restricted to unidirectional part of this consideration
>> [j] ?
>>
>>
>
> Yep. You can either define the read more or the write mode (stdout vs
> stdin) but not both, since popen() opens ONE pipe.
>
>
>
>> Also I read [j] that a problem with popen is that you do not get pid
>> of child so you cannot wait on command to complete. Could posix_spawn
>> be preferrable to popen?
>>
>>
> Exactly. There is no standard way to get child pid from popen() so you
> can't do polling in image side to wait it's completion.
> So yeah, posix_spawn() does fix this issue as well as many many other.
>
Looks nice and at the same time, popen support is useful/wanted. A generic
way to deal with pids (in Linux at least, is to have the process write its
pid in /var/run/ or a subdir of it.
That's how monit checks for processes for example.
http://unix.stackexchange.com/questions/12815/what-are-pid-and-lock-files-f…
We need as many options as we can here.
Mariano, I added you to a Trello board that captured a couple of items
about the topic you deal with.
https://trello.com/b/Hji4F0Zp/clipharo
We also have a card that says the following:
Pharo follows Smalltalk which uses a global object named Smalltalk which in
fact is an instance of SmalltalkImage, confusing if you ask me.
I would add a simple class named System which have class-side accessors for
static global things like
- image => links to the old Smalltalk
- stdin
- stdout
- session
- environment for ENV vars
- workingDirectory accessing the process working directory $PWD
- 'pid'
That's a very easy thing to do, but IMO it will help anybody coming from
outside smalltalk to easily find these things. Probably there are more
things that would fit here.
I'd like to have that.
The discussion involved Camillo who was very into these topics. His
Pinocchio work seemed to have contributions that can be useful of the CLI
support for Pharo.
Phil
>
>
>> and just btw, mildly interesting is using sockets rather than pipes
>> for interprocess communication [l]
>>
>> [j]
>> http://stackoverflow.com/questions/3884103/can-popen-make-bidirectional-pip…
>> [k] http://stackoverflow.com/questions/6743771/popen-alternative
>> [l]
>> http://stackoverflow.com/questions/25161377/open-a-cmd-program-with-full-fu…
>>
>>
> Thanks. I will check that on a second step ;)
>
>
>> >
>> > 2) We believe that there is a large number of OSProcess users that use
>> > OSProcess only for executing OS commands AND popen() approach would be
>> more
>> > than enough (we will do a survey about this). So, a very simply
>> solution via
>> > FFI for these users rather than having all OSProcess, Command Shell, the
>> > plugins etc, may be worth.
>> >
>> > What do you think?
>> >
>> >>
>> >> Now, given some of the difficulties seen when dealing with external
>> >> processes, I'd be wary of the "async" side of things. Random failures
>> >> seemingly linked to signal loss are certainly not something I'd like to
>> >> debug.
>> >>
>> >
>> > Indeed, it won't be easy I guess. But sometimes the process you execute
>> may
>> > take quite some time and blocking the VM for that period is not a good
>> > choice. So... what would you prefer to solve that? Do you prefer
>> image-based
>> > pooling as OSProcess does when IOPlugin is not used?
>>
>>
>> How much might your work overlap with the Threaded FFI project for Cog?...
>> ..."The Cog VM is single-threaded, providing green threads to the
>> Smalltalk level, as do most Smalltalk VMs. There is a prototype
>> subclass of the CoInterpreter, CoInterpreterMT, which provides a
>> Python-like multi-threaded VM where any number of threads can share
>> the VM with only one running the VM at any one time. This uses an
>> extremely simple low-level scheme for releasing and re-acquiring
>> ownership of the VM designed by David Simmons. This results in any
>> and all FFI calls being non-blocking since there is such a low
>> overhead to making a non-blocking FFI call that all FFI calls can be
>> non-blocking. Eliot has worked on this, implementing the prototype
>> and the reentrant FFI plugin it requires. But this needs to be
>> revived. It would be a really powerful enhancement."
>>
>>
> Well, Eliot said I may need to give a hand to them in order to finish the
> Threaded FFI. However, I am still not 100% certain if the threaded FFI
> calls to read from pipes would be worth. Eliot said that yes. Anyway, once
> I have the first version working I will digest this and goes to the next
> level and see how I can make things better than polling, if polling proves
> to be a problem.
>
>
>
>> cheers -ben
>>
>> P.S. Just another article warning against mixing fork and
>> multiple-threads (which it seems posix_spawn may avoid)...
>>
>> http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-usi…
>>
>>
> Thanks for the reference.
>
> Cheers,
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
Dec. 23, 2015
Re: [Pharo-dev] Can I access symbolic constants from NB FFI?
by phil@highoctane.be
Maybe this: https://github.com/ronsaldo/swig/
On Tue, Dec 22, 2015 at 9:24 PM, tesonep(a)gmail.com <tesonep(a)gmail.com>
wrote:
> Hello Mariano,
> WNOHANG is a constant is defined in sys/wait.h, after the
> compilation is not included in the object file.
>
> You will have to duplicate its value in the Smalltalk Code. It's value is
> 1, in linux is defined in bits/waitflags.h as
>
> #define WNOHANG 1
>
> Cheers,
> Pablo
>
> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <
> marianopeck(a)gmail.com> wrote:
>
>> Hi guys,
>>
>> Say I want to call to waitpid like this:
>>
>> waitpid(childID, &status, WNOHANG);
>>
>> How can I do since I don't have access to WNOHANG int value in order to
>> send it via argument .... ???
>>
>> Any idea?
>>
>> Thanks in advance,
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Pablo Tesone.
> tesonep(a)gmail.com
>
Dec. 23, 2015
Re: [Pharo-dev] How to create a 16x16 icon from a .png file?
by stepharo
Look for users of ReadWriterPNG
ReadWriterPNG formFromStream: (Filesystem workingDirectory / 'blb.png)
Works
Le 22/12/15 14:11, Alexandre Bergel a écrit :
> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cubeâ
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre
Dec. 23, 2015
new CryptOCap architecture, known as the Split Mushroom
by Robert Withers
Split Mushroom
--
. .. ... ^,^ robert
Go Panthers!
Dec. 23, 2015
Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort
by Mariano Martinez Peck
>
>
> >
> >
> > No, wait. You are getting down to the details so I want to discuss :)
> >
> > OSProcess does not use popen()/system() but rather fork()+exec(). That
> means
> > that OSProcess has implementing the very very low building blocks that
> would
> > allow you do to almost everything. But then it has it's complicated
> matters.
> > fork() + exec() cannot be implemented via FFI (this was already
> discussed in
> > another thread).
>
> Can you link that thread? I'm curious to learn this.
It's a bit long discussion, but here it is:
http://forum.world.st/ANN-Limbo-a-simple-shell-wrapper-for-NativeBoost-td46…
Is it
> multi-thread related? I read [a]...
> ..."The biggest problem with using fork+exec in this way is that you
> can't guarantee *nothing* happens between the fork call and the exec
> call. If, for example, the JVM decides to GC or move memory around,
> you can have a fatal crash at the JVM process level. Because of that,
> I don't recommend using fork + exec via FFI in JRuby, even though it's
> pretty cool. "
>
>
Yes, exactly. Pretty much the same. Since fork() clones and both parent and
child execute same code (smalltalk vm in our case) until you call exec(),
for that period of time, you will have the child running too, and that can
screw up everything.
..."However, since this post I've learned of the "posix_spawn" [b]
> function available on most Unix variants. It's basically fork + exec
> in a single function, plus most of the typical security and IO tweaks
> you might do after forking and before execing. It's definitely my
> recommended alternative to fork+exec for JRuby."
>
*WOW. This seems to be one of the most useful recommendations I got. Thank
you VERY MUCH.*
I was thinking myself "how could I be the only one trying to call a
fork+exec kind of function from FFI". Here is the answer.
BTW...I have already started coding a FFI wrapper for such a function. I
have very basic first command working :)
>
> And posix_spawn also seems recommended for use with the JVM [d]
>
Nice.
> and that Windows and POSIX might have similar usage, and even better
> match Windows CreateProcess than fork/exec [f] [g] [h]
>
> And since with 64-bit Spur we can expect very large images, spawn may
> be preferred over fork/exec to minimize memory usage for creating
> application subprocesses [i]
>
>
Interesting.
>
> Fork versus threads section of [c]
>
> or should we be making use of pthread_atfork [e] ?
>
> Overall I learnt something new about forking in a multi-threaded
> environment
> "When fork() is called, only the calling thread is duplicated in the
> child process."
>
I learned that today too :)
>
> [a]
> http://blog.headius.com/2009/05/fork-and-exec-on-jvm-jruby-to-rescue.html
> [b]
> http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
> [d] http://skife.org/java/2012/01/24/java_daemonization_with_gressil.html
> [c] http://repository.readscheme.org/ftp/papers/sw2002/gasbichler.pdf
> [e]
> http://stackoverflow.com/questions/4223553/c-does-exec-have-to-immediately-…
> [f]
> http://stackoverflow.com/questions/33249253/what-is-the-difference-between-…
> [g] http://stackoverflow.com/questions/5883462/linux-createprocess
> [h]
> http://www.linuxquestions.org/questions/programming-9/fork-exec-versus-posi…
> [i]
> http://www.oracle.com/technetwork/server-storage/solaris10/subprocess-13643…
>
>
Thanks for all the links, very useful!
> > However, there is a lot of other stuff that we believe it
> > could. So... what we wanted to see if it is possible is to have one only
> (or
> > very few) primitives (like forkAndExec) and all the rest via FFI. And
> then
> > all the features I listed in the first email of this thread.
> >
> > With that in mind, we believe that:
> >
> > 1) Before starting dealing with forkAndExec, we could try a first
> prototype
> > using popen(). That would allow us test a 100% FFI based approeach, deal
> > with writing and reading from pipes via stream, face the blocking issue,
> see
> > a prototype on how to read async from pipes etc etc etc. If we see this
> > works nicely, on a second step we can build another approach that
> instead of
> > popen() uses forkAndExec primitive.
>
> Is popen() being restricted to unidirectional part of this consideration
> [j] ?
>
>
Yep. You can either define the read more or the write mode (stdout vs
stdin) but not both, since popen() opens ONE pipe.
> Also I read [j] that a problem with popen is that you do not get pid
> of child so you cannot wait on command to complete. Could posix_spawn
> be preferrable to popen?
>
>
Exactly. There is no standard way to get child pid from popen() so you
can't do polling in image side to wait it's completion.
So yeah, posix_spawn() does fix this issue as well as many many other.
> and just btw, mildly interesting is using sockets rather than pipes
> for interprocess communication [l]
>
> [j]
> http://stackoverflow.com/questions/3884103/can-popen-make-bidirectional-pip…
> [k] http://stackoverflow.com/questions/6743771/popen-alternative
> [l]
> http://stackoverflow.com/questions/25161377/open-a-cmd-program-with-full-fu…
>
>
Thanks. I will check that on a second step ;)
> >
> > 2) We believe that there is a large number of OSProcess users that use
> > OSProcess only for executing OS commands AND popen() approach would be
> more
> > than enough (we will do a survey about this). So, a very simply solution
> via
> > FFI for these users rather than having all OSProcess, Command Shell, the
> > plugins etc, may be worth.
> >
> > What do you think?
> >
> >>
> >> Now, given some of the difficulties seen when dealing with external
> >> processes, I'd be wary of the "async" side of things. Random failures
> >> seemingly linked to signal loss are certainly not something I'd like to
> >> debug.
> >>
> >
> > Indeed, it won't be easy I guess. But sometimes the process you execute
> may
> > take quite some time and blocking the VM for that period is not a good
> > choice. So... what would you prefer to solve that? Do you prefer
> image-based
> > pooling as OSProcess does when IOPlugin is not used?
>
>
> How much might your work overlap with the Threaded FFI project for Cog?...
> ..."The Cog VM is single-threaded, providing green threads to the
> Smalltalk level, as do most Smalltalk VMs. There is a prototype
> subclass of the CoInterpreter, CoInterpreterMT, which provides a
> Python-like multi-threaded VM where any number of threads can share
> the VM with only one running the VM at any one time. This uses an
> extremely simple low-level scheme for releasing and re-acquiring
> ownership of the VM designed by David Simmons. This results in any
> and all FFI calls being non-blocking since there is such a low
> overhead to making a non-blocking FFI call that all FFI calls can be
> non-blocking. Eliot has worked on this, implementing the prototype
> and the reentrant FFI plugin it requires. But this needs to be
> revived. It would be a really powerful enhancement."
>
>
Well, Eliot said I may need to give a hand to them in order to finish the
Threaded FFI. However, I am still not 100% certain if the threaded FFI
calls to read from pipes would be worth. Eliot said that yes. Anyway, once
I have the first version working I will digest this and goes to the next
level and see how I can make things better than polling, if polling proves
to be a problem.
> cheers -ben
>
> P.S. Just another article warning against mixing fork and
> multiple-threads (which it seems posix_spawn may avoid)...
>
> http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-usi…
>
>
Thanks for the reference.
Cheers,
--
Mariano
http://marianopeck.wordpress.com
Dec. 23, 2015
Re: [Pharo-dev] [Pharo-users] [ANN] Pharo Consortium Sponsored Development Effort
by Robert Withers
I had a few further thoughts... Now that governments cannot control the
flow of information, they no longer have the initiative and are
completely responsive and reactive in their modus operandi. This is due
to the political forces that modern styles of communication allow to
emerge. These forces mold opinion and they influence activities, in many
realms.
Sovereignty is defined as able to have claim, capacity and control, or
dominion, agency and possession. They, governments and their adjuncts,
have lost control. They have lost possession due to the limited
capacity their model represents in comparison. Modern communications and
swarm activities have control. The internet has control and possession.
Without control, or possession, the three foundations upon which the
definition of Sovereignty lay is demolished. The foundations of the
Peace of Westphalia are destroyed.
We must fall back to the Peace of Augsburg and the Sovereignty of
City-States. Die Stadt Uber Alles!
My question to you is what role do you envision Pharo playing in modern
communications, which controls the fate of Nation-States as they devolve
into City-States.
A suggestion: Operations Management. Thus the self-replicating Piconet
Manager...
best,
robert
Piconet Manager
On 12/21/2015 11:20 AM, Robert Withers wrote:
>
>
> On 12/21/2015 10:17 AM, Denis Kudriashov wrote:
>>
>> 2015-12-21 11:19 GMT+01:00 Robert Withers <robert.w.withers(a)gmail.com
>> <mailto:robert.w.withers@gmail.com>>:
>>
>> governments cannot crack it.
>>
>>
>> Why it is disadvantage?
>
> Governments stay in power, or exercise collective sovereignty, through
> dominion, agency and possession. Loss of control over information, and
> by extension currency, affects possession, or having control. They
> still have dominion and agency, but without three legs you can build
> no stool to sit upon. If loss of control over information and currency
> undermines possession, then the concept of the modern nation-state is
> undermined. I view this as a negative.
>
> --
> . .. ... ^,^ robert
> Go Panthers!
--
. .. ... ^,^ robert
Go Panthers!
Dec. 23, 2015