OS2World OLD-STATIC-BACKUP Forum

OS/2 - Technical => Programming => Topic started by: Blonde Guy on 2009.10.09, 07:52:37

Title: OS/2 queues
Post by: Blonde Guy on 2009.10.09, 07:52:37
I've had problems with queues under OS/2. Queues are used for Interprocess Communication.

Create a queue with

#define INCL_DOSQUEUES   /* Queue values */
    #include <os2.h>

    HQUEUE hq;

    DosCreateQueue(&hq, QUE_FIFO |
                   QUE_CONVERT_ADDRESS,
                   "\\queues\\sample.que");

It works great, and you can read, write, peek, etc. But if there are more than about 3000 messages in the queue, OS/2 becomes unstable. And that 3000 is the number of messages in any queue system-wide, not per queue.

Anyway, I complained long ago to Scott Garfinkle, and he sent me a fix. I think the fix works, at least in my test code, but I don't think it was ever released.

I'm attaching the fix to this message. I don't know if it will ever be of any use to someone. How many people even use queues?

Title: Re: OS/2 queues
Post by: Radek on 2009.10.09, 10:17:33
Stored for possible later references :) Is the DLL UNI or SMP? It's doscall1.
Title: Re: OS/2 queues
Post by: warpcafe on 2009.10.09, 11:17:21
Hi Blondeguy,

well... currently I'm not using queues but I might be using them someday from rexx. I gave it a couple of tries before and found my understanding of how queues ahould work clashing with the results. :) I guess I simply was too "lazy" to give it the attention it required. Anyway, someday I will use them... and then, I would like to have something reliable under the hood.
As Radek said: "Stored for later reference". Same here. ;)

BTW - this seems to be a  VERY suitable candidate for uploading to Hobbes.
I noticed it's not there yet, however there is some patch file for doscall and process commander... any idea how this relates to "your" version of doscall?

Regards,
Thomas
Title: Re: OS/2 queues
Post by: Fahrvenugen on 2009.10.09, 17:39:05
Yup, I would love to know if this is the SMP or the Uni version of doscall1.dll

Title: Re: OS/2 queues
Post by: Blonde Guy on 2009.10.10, 17:53:41
The fix is from a time when Scott was working with the kernel. If you think back to that time, we were all using the W4 version of the kernel, not UNI or SMP.

But, unless you're working on the operating system distribution, this version of DOSCALLS isn't worth much. I maintain a program that uses queues extensively, and I was able to get it to work reliably by ensuring that there were only a few messages in the queues.

With this fix, the system remained stable. When the system runs out of resources, it remains stable. If you want to use queues heavily, I'd recommend implementing your own, rather than use the limited implementation on OS/2. It's pretty clear that if the total memory allocated to messages exceeds 64K, queues stop working (if you run the fix) or OS/2 stops working.

Neil
Title: Re: OS/2 queues
Post by: abwillis on 2009.10.10, 18:54:14
This'll work on W4 or Uni either one then, only the SMP requires a special version.  What time frame was this?  Mozilla puts today's date on the file when I download it.
Andy