• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A Dilemma about synchronous blocking and SSL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Dilemma about synchronous blocking and SSL


  • Subject: A Dilemma about synchronous blocking and SSL
  • From: Larry Gerndt <email@hidden>
  • Date: Tue, 15 Jul 2003 23:44:46 -0700

I have a dilemma to solve which I could use a little advice on:

I use two MP Tasks, one for reading a socket, the other for writing to it.
The socket is configured for blocking reads and writes. Apparently the
socket has no problems with these two threads being preemptive, you can
write and read from preemptive tasks on a single socket. However, according
to Doug Mitchell from Apple, SSL does not work that way. He says that
SSLWrite and SSLRead on a single shared context are not thread safe between
two preemptive tasks. This means I have to make a "critical region" (a
mutually exclusive region made via the MP API) around the calls to SSLWrite
and SSLRead. But this poses a problem: Once I enter the critical region to
do a read, it blocks until data actually arrives, which may be a long time
if ever. Meanwhile, since it's in the critical region, no writes can occur.

The only solution I can think of to solve this dilemma is to make the socket
non-blocking. Am I correct? I hate to do this because synchronous blocking
is so much cleaner, code wise, and my existing code makes use of it a lot.
But I got away with it because sockets apparently do not impose this
restriction.
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Are SSLWrite and SSLRead callable from MPTask?
  • Next by Date: RE: A Dilemma about synchronous blocking and SSL
  • Previous by thread: Re: SSLSetConnection usage
  • Next by thread: RE: A Dilemma about synchronous blocking and SSL
  • Index(es):
    • Date
    • Thread