• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Great read on SMP on EDM/2

Started by RobertM, 2008.08.15, 22:26:54

Previous topic - Next topic

RobertM

Hey all,

I know this is an older article, but a lot still applies, and I found it very interesting (and figured I'd post it here since people in various threads had been asking about how SMP works/performs under OS/2):

http://www.edm2.com/0507/smp.html

Rob


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


RobertM

Here's a tip for SMP systems that I couldnt seem to find in the OS/2 help files (maybe it's in one of the HTML ones that the help viewer cant check?).

To mark an exe as SMP Unsafe, use this:

"EXECMODE /SP <application>"

Rob


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Pete

Hi Robert


I did not know that - but I have been using markexe.exe instead eg

markexe mpunsafe <Drive:\Path\app.exe>

markexe.exe is part of the OS/2 Toolkit

I mention the OS/2 Toolkit as the toolsref.inf file supplied with the Toolkit contains the only mention of execmode on my system - and that is as a Note in the section "Requirements for Multi-Processing". I reproduce the entire page for the benefit of those without a copy of the Toolkit:-


The following compatibility's requirements should be considered before running an application in multi-processor mode:

An application or associated subsystem must not use the 'INC' instruction as a semaphore without prepending a 'LOCK' prefix. On a UniProcessor (UP) system this instruction can be used as a high-performance semaphore without calling any other operating system service if the semaphore is free and when the semaphore is clear and there are no waiters for the semaphore. Because the INC instruction cannot be interrupted once started, and because the results would be stored in the flags register which are per thread, then it could be used safely as a semaphore.

In an OS/2 for SMP environment, this technique will not work because it is possible that two or more threads could be executing the same INC instruction, receiving the same results in each processor's or thread's flag register and thinking that they have the semaphore.

A 486 or greater instruction such as CMPXCHG has the same problem as above if a 'LOCK' prefix is not prepended before the instruction.

An application or associated subsystem which relies on priorities to guarantee execution of it's threads within a process will not work in OS/2 for SMP. For example, an application may have a time-critical and an idle thread, and may assume that while the time-critical thread is executing the idle thread will not get any execution time unless the time-critical thread explicitly yields the CPU. In an OS/2 for SMP environment it is possible that both the time-critical and the idle threads are executing simultaneously on different processors.

The above compatibility requirements apply only to multi-threaded applications, and therefore do no apply to DOS and WINOS2 applications. However, you are strongly encouraged to write 32-bit multi-threaded applications for better performance and portability on OS/2 for SMP.

Given the possibility that some set of applications may use one of these techniques, OS/2 for SMP Version 3 provides a mechanism whereby these multi-threaded applications can execute in UP mode. Only one thread of that process would be allowed to execute at any given time. That thread could execute on any one of the processors. MARKEXE can be used to mark the EXE file as uniprocessor only. OS/2 forces the process to run in the uniprocessor mode when the loader detects that the EXE file has been marked as uniprocessor only.

Note:  OS/2 Warp Version 3 (non-SMP) still ships the EXECMODE utility.



The above sort of reads as though markexe replaces execmode for Warp4 and later...


Hope the above is of interest.

Pete




Ben

Quote from: RobertM on 2008.08.15, 22:51:42
Here's a tip for SMP systems that I couldnt seem to find in the OS/2 help files (maybe it's in one of the HTML ones that the help viewer cant check?).

To mark an exe as SMP Unsafe, use this:

"EXECMODE /SP <application>"

Rob

Greetings, RobertM.

Say, that's a useful tip and one that I can use personally.

The question is; where does one enter this parameter?

Thanks.

RobertM

Quote from: Ben on 2008.08.16, 03:38:44
Quote from: RobertM on 2008.08.15, 22:51:42
Here's a tip for SMP systems that I couldnt seem to find in the OS/2 help files (maybe it's in one of the HTML ones that the help viewer cant check?).

To mark an exe as SMP Unsafe, use this:

"EXECMODE /SP <application>"

Rob

Greetings, RobertM.

Say, that's a useful tip and one that I can use personally.

The question is; where does one enter this parameter?

Thanks.


Ooops.... sorry, forgot that part.

Simply open a commandline window, type EXECMODE /SP F:\MyAppFolder\MyApp.exe (and of course, hit enter). It will then tell you if it was successful.

The /MP option clears the /SP option from the file. There are other options as well - typing just EXECMODE at a command prompt will list them all in verbosity (hence, I'd change your VIO window size to at least 45 lines, which is how much it takes to display the options on one screen - or use the |more option).

Rob


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Fahrvenugen

Hi,

A quick question, as I've never tried it under SMP.

Does Paul Smedley's port of MySQL,  PHP, and Apache cooperate with SMP (or are SMP safe)? I've got a machine running as a web server I'm considering going to SMP on, and wondering if it is worth the effort to do so.

Thanks!

El Vato

Quote from: Fahrvenugen on 2008.08.16, 17:42:49
Hi,

A quick question, as I've never tried it under SMP.

Does Paul Smedley's port of MySQL,  PHP, and Apache cooperate with SMP (or are SMP safe)? I've got a machine running as a web server I'm considering going to SMP on, and wondering if it is worth the effort to do so.

Thanks!


Fahrvenugen,

The b2evolution posting, despite all the misunderstanding on the last reply by my friend ModZilla  :) , was done on an SMP machine.  The metrics, however, you are in a better position to judge against your current performance on your UNI platform.

Hence, although the Apache, MySQL, and PHP, standard open source stack seem to work in my limited test case, Smedley might provide further insight.

Fahrvenugen

Thanks El Vato,

I'm inclined to think that if hyou didn't run into any difficulties with that being an SMP machine, then Apache / MySQL / PHP are SMP safe and quite likely can benefit from SMP.

That's my big thing - I don't want to spend the time / $ on SMP for this machine if I'm not going to see benefit on those apps.

RobertM

Hi Fahrvenugen ,

I can confirm I have successfully been running MySQL v5 on an SMP machine with no problems... yet to try the other two on anything other than UNI (so far). So, that's at least two votes for MySQL...

Robert


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Fahrvenugen

Robert,

Thanks for that confirmation, it makes me think that I won't run into any difficulties running that server as an SMP based system and I'll probably see benefits.  I know the newer ports of Apache do threads pretty well (although admittedly the older 1.3 based builds were poor in this respect, the 2.x builds appear to do multiple threads very well) so I should see benefit in this area too.

If only I could figure out how to get PHP to work properly with LDGW I'd be even happier, and that just flies on SMP, but I've never been able to get it to work 100%, and any time I've tried the parts of PHP that doesn't seem to work properly is some part that's required by the stuff I'm trying to host...


RobertM

Quote from: Fahrvenugen on 2008.08.18, 02:05:10
If only I could figure out how to get PHP to work properly with LDGW I'd be even happier, and that just flies on SMP, but I've never been able to get it to work 100%, and any time I've tried the parts of PHP that doesn't seem to work properly is some part that's required by the stuff I'm trying to host...

Same here... I have a feeling it is due to the lack of all the plugins Apache has, but I am not sure (ie: that's just a guess)... but yeah, I am thrilled with LDGW's performance on an SMP system.

Rob


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Paul Smedley

Quote from: Fahrvenugen on 2008.08.16, 17:42:49
Hi,

A quick question, as I've never tried it under SMP.

Does Paul Smedley's port of MySQL,  PHP, and Apache cooperate with SMP (or are SMP safe)? I've got a machine running as a web server I'm considering going to SMP on, and wondering if it is worth the effort to do so.

I've been running these ports on Dual core (and now Quad-core) CPU's for a while now with no problems evident

Fahrvenugen

Thanks for the confirmation.  That makes me want to definitely recommend setting the server machine in question up as an SMP.

And again, thanks for all your great work Paul!