concurrent design for check

Featuring the Dragonfly web framework
Locked
ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

concurrent design for check

Post by ssqq »

I want check a variable value till another process send it to it, then do other thing. How to design it?

Code: Select all


(while (check-var-is-true) (do-some-thing))


rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: concurrent design for check

Post by rickyboy »

Can you give details about what you're trying to do? What you are describing could be almost anything.

The basic idea is that, if you can't avoid the `do-some-thing` procedure being non-functional, then you hope that, at least, it frobs a variable that you can see in your caller; then, you can just check that. A general example of this setup is checking for EOF when in a loop reading from a file.

But if you can avoid such a situation, it's better to design something functional.
(λx. x x) (λx. x x)

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: concurrent design for check

Post by TedWalther »

What do you mean by "functional". Goroutines? channels? slots? shared memory? NewLISP has built in "send" and "receive" functions... maybe that does with ssqq wants?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: concurrent design for check

Post by rickyboy »

TedWalther wrote:What do you mean by "functional". Goroutines? channels? slots? shared memory?
As in functional programming -- procedures that act like mathematical functions in that they only operate on their arguments and don't side-effect. Wow, Ted, as long as I've been talking about FP in this forum, I'm surprised *you* asked this question. :)
TedWalther wrote:NewLISP has built in "send" and "receive" functions... maybe that does with ssqq wants?
Right. I asked for such detail from ssqq for precisely this reason. Let's see what ssqq says. Otherwise, as I said, it's a guessing game.
(λx. x x) (λx. x x)

ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

Re: concurrent design for check

Post by ssqq »

I design a function model to implement "return" from any depth block.

in general, when call (return sth) in function, current function namespace would find a return value have been ready.

when return expression is in deep block, return message would be receive by main process after serval value pass.

If I use concurrent, send a message to main process, then is simply.

But send message directly to main process would destroy block stack management, if return expression is at last expression of function, restore some management variable is too waste time.

So i think, order compute is better than concurent compute in this function module.

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: concurrent design for check

Post by TedWalther »

rickyboy wrote:
TedWalther wrote:What do you mean by "functional". Goroutines? channels? slots? shared memory?
As in functional programming -- procedures that act like mathematical functions in that they only operate on their arguments and don't side-effect. Wow, Ted, as long as I've been talking about FP in this forum, I'm surprised *you* asked this question. :)
I read this:

http://unqualified-reservations.blogspo ... earch.html
http://unqualified-reservations.blogspo ... ments.html

Then I read the design paper for Urbit and Nock.

Then I noticed that noone actually programs in continuation passing style, it is too hard. It is just an intermediate representation to make it easy to detect tail recursion.

Then I noticed that my IQ is 15 points lower than the necessary minimum to use Haskell well.

So.... functional programming? Nice idea, but all the interesting stuff I do involves side effects. Pure mathematical style functions are so rare in my world, why should I optimize my whole programming methodology around it? I want to get stuff done.

Since ssqq was asking a question about two entities interacting over time, I don't see how "functional" programming could even enter the picture. You can't compile these interactions over time down to a single value or function call return.

So, given all this... what do you mean by "functional" style of programming, to do such a task?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

Locked