bugGNUstep - Bugs: bug #9798, DO does not work in multithreaded...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9798: DO does not work in multithreaded program if lots of threads are created

Submitted by:  Willem Rein Oudshoorn <wim>
Submitted on:  Wed 28 Jul 2004 09:57:53 AM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 24 Aug 2004 08:14:22 AM UTC, comment #1:

Thanks for the report. I believe this is now fixed in CVS.
The problem was that when using DO between threads, both threads have a copy of each port, so killing a connection would not invalidate the ports and the underlying network handles would therefore not be closed.
Now, when a connection is invalidated, it determines the underlying network connection in use (GSTcpHandle or GSMessageHandle) and specifically invalidates that handle.
This leaves the ports intact (another connection may be using them) unless there was only one handle in the port.

Richard Frith-Macdonald <CaS>
Project Member
Wed 28 Jul 2004 09:57:53 AM UTC, original submission:

If DO are used to communicate between threads and
lots of threads are created DO will stop functioning.
This is demonstrated in the attached program.

As far as I can tell the following is happening.

The crash/exception is caused by the fact
that the number of file descriptors we are
waiting for in the select call is larger than the
OS limit FD_SETSIZE (=64).

These file descriptors are used in the main thread listening
to the request from the other threads.
So this is to be expected if we have 64 threads talking
to the main thread at the same time.
But even at any given time no more than 2 threads exists,
the problem is still there. It seems that if a thread
is finished, the main thread does not know that it can
stop listening and keeps the GSTcpHandles around.

Unfortunately I am a little bit lost in the DO code,
so I hope someone has some idea how to solve this.

BTW: I have only tested this on MinGW. So it could
be MinGW specific.

Wim Oudshoorn.

Willem Rein Oudshoorn <wim>
Project Member

 

Attached Files
file #1607:  nsconnection-test.tar.gz added by wim (1KiB - application/x-gzip - Program to reproduce the crash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 24 Aug 2004 08:14:22 AM UTCCaSStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Wed 28 Jul 2004 09:57:53 AM UTCwimAttached File-=>Added nsconnection-test.tar.gz, #1540

Back to the top


Powered by Savane 3.1-cleanup1