Jump to content

Please help me with this riddle


empieters

Recommended Posts

Hello

 

Can you help me?

I have 2 pc's A en B.

There is a program that I run.

 

If I run a particular php script then on pc A it hangs, on B it does not.

But when I do write statements to an out file I see that both programs have calculated and the script even returns after doing his work to the calling program.

So on pc A it does not 'see' it is finished.

 

To help:

There is a loop that loops around 2000 times each time after reading a record from a sql database.

If I break earlier for instance after 1500 times, then suddenly both programs end normally.

 

So the question. What could happen in a loop, that prevents a program from ending and hangs, while an other pc does not?

There is lots of processing after the loop, that is executed in both situations.

 

Both PC use IE but also Firefox does the same. On top of that also IE's version is the same on both PC's.

 

I am out of clues. Can you point me in the right direction?

please mail to empieters@gmail.com if you have questions.

Edited by empieters
Link to comment
Share on other sites

It IS doing something.In fact it does everything it must do. The only thing missing is that it does not seem to know the script is finished. And it has. I call the function and one line futher I echo 'finished' to an out file and that is written.

It does just not understand that the script has finished. There is a loop that is run a lot of times and when I make the number smaller it DOES know it is finished. As if there a limit to the number of loops. The peak memory usage is the same all the time.

It is just a riddle. It works on one PC but not on another. Same browser, same network...

Link to comment
Share on other sites

What.. The..?

 

Do you mean you have two PCs ( PC-A and PC-B ) neither of them are the Server ( hosting the PHP ) but both are connecting to the Server where the run Whatever.PHP and PC-A shows different results to PC-B?

 

If so, due to PHP being a server-side programming language ( meaning it runs all code and logic on the Server ) neither PC-A nor PC-B will have any effect on the PHP being run, so they cannot be playing havoc with loops, or anything else as that's all taken care of by the Server before either PC would see any results.

 

So, if this is the case. And at-least one PC is showing as working correctly then you have an issue on any PC where it isn't showing the correct results.

 

Which opens up millions of possibilities.

Edited by l0gic
Link to comment
Share on other sites

Yes that is correct. In real life there are 6 co-workers of mine running the program and with some it finished and with others it does not.

It is just a program that one can run over the internet.

If I shorten the loop by breaking halfway, all the co-workers's programs finished.

I tried the first half AND the second half of the lines to proces to see if one line caused the problem, but it is not inside the lines as in both situations (first half and second half of the lines) the program finishes.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.