Hi,
I was searching for forking possibility on windows and found winfork, but it seems that is not working:
the response from newlisp is:
>(winfork '(+ 1 2))
1832
>
ERR: missing parenthesis : "...(silent
After looking in source and little debuging, also found that simple process invocation
> (process {newlisp -e \"(+ 1 2)\"})
1868
>
ERR: string token too long : "(+"
also generate error????
Is this bug or feature? :-) or I'm doing something wrong. I'm using newlisp v.10.1.5 and v.10.1.6 and on both version is same.
So I think there is no problem in winfork....
On Linux everything is working fine, process invocation is working, but there I prefer spawn....
bye,
Robert
winfork and process problem on windows
-
- Posts: 12
- Joined: Tue Oct 27, 2009 9:01 pm
- Location: Croatia
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
Re: winfork and process problem on windows
Not able to try this here, but if the code predates newLISP version 10 then there have been some changes in the syntax of a few functions - write-buffer perhaps? Could be worth checking.
Re: winfork and process problem on windows
Unfortunately I don't think the winfork.lsp module has been updated in any way in a long time. I also don't believe it's hosted on, or even linked anywhere on the official newLISP site, so we can't really remove it. It might be wise for whoever is hosting it to remove it, update it, or put a big disclaimer that it definitely won't work in recent versions.
How did you come across the winfork.lsp module, and what are you trying to use it for?
How did you come across the winfork.lsp module, and what are you trying to use it for?
-
- Posts: 12
- Joined: Tue Oct 27, 2009 9:01 pm
- Location: Croatia
Re: winfork and process problem on windows
Well, someone, perhaps Peter, mentioned in older posts, so I wanted to try it because under windows spawn is not working. It can be downloaded from his site.
I don't think that this is not working because of some different behaving function, I can't properly start another newlisp -e via process.....
But biger problem for me is that (process {newlisp -e "(+1 2)"}) is not working, it gives error message mentioned on my previous post.
Simply I tried to use idea from Peter's winfork, to start other newlisp process, copy environment, but is not working this way.
I tried other combination, to start via process newlisp -c waiting on some port, then send source code and execute required function and this works fine, but is not easy to use it like fork or spawn.
I need it because I want to run several things in parallel, to get some http pages from slow data generating web server and i'm stuck on this poor windows xp os...
I don't think that this is not working because of some different behaving function, I can't properly start another newlisp -e via process.....
But biger problem for me is that (process {newlisp -e "(+1 2)"}) is not working, it gives error message mentioned on my previous post.
Simply I tried to use idea from Peter's winfork, to start other newlisp process, copy environment, but is not working this way.
I tried other combination, to start via process newlisp -c waiting on some port, then send source code and execute required function and this works fine, but is not easy to use it like fork or spawn.
I need it because I want to run several things in parallel, to get some http pages from slow data generating web server and i'm stuck on this poor windows xp os...
Re: winfork and process problem on windows
On Windows add another pair of single quotes:
For a 'fork' in Windows, define this:
Pass the expression to be evaluated unquoted:
The 'fork' will return at once and the page is retrieved and written in the background.
If you have several 'fork' calls one after the other, they might interfere with each other using the same file-name "all" you could use (uuid) to create a unique file-name and then delete it at the end of the 'fork' function.
Code: Select all
(process {newlisp -e '"(+ 3 4)"'})
Code: Select all
(define-macro (fork expr)
(save "all")
(append-file "all" (string "\r\n" expr "\r\n(exit)\r\n"))
(process "newlisp all"))
Code: Select all
(fork (write-file "page.html" (get-url "http://newlisp.org")))
If you have several 'fork' calls one after the other, they might interfere with each other using the same file-name "all" you could use (uuid) to create a unique file-name and then delete it at the end of the 'fork' function.
-
- Posts: 12
- Joined: Tue Oct 27, 2009 9:01 pm
- Location: Croatia
Re: winfork and process problem on windows
thanks Lutz,
that is what I need!
that is what I need!