Multithreading

From: [at]} <Wojtek>
Date: Sat, 15 Feb 2003 21:26:43 -0500 (EST)

----boundary-LibPST-iamunique-991511038_-_-
Content-type: text/plain

Hello:

  I would appreciate hearing from an expert whether
multithreading in BlackBox 1.5 is planned, and whether
it is a good concept. I have recently seen a situation
it perhaps would be beneficial. I am acquiring data
from a USB device using the standard Windows call
WinApi.DeviceIoControl. This call appears to be blocking,
i.e., it does not return unless the device sends the
requested data. In case the device does not have data,
the call stalls, and as a consequence BlackBox becomes
unresponsive (an hour glass appears on screen).
It would be possible to force the pending data transfer
by sending another request to the device over a separate
USB endpoint, but since BlackBox is single-threaded,
this cannot be done from within the environment.

I solved the problem by pinging the USB device with
the request "do you have data", which is always answered
yes/no without any waiting. I am only performing
the data transfer when the precondition has been
established that there indeed is data. The hourglass
no longer is a problem. However, this was possible only
because I have full control over the USB firmware,
such that I could modify the firmware to implement
the ping.

I therefore hesitate to say this is a decisive example
that multithreading is necessary. However, I hear
about multithreading so often, that I would like to ask.
Is it necessary? Is it beneficial? Is the extra complexity
due to multithreading warranted? Can one always substitute
a single-threaded solution where the apparent need for
multithreading seems to exist?

Please e-mail the answer to me directly because I am only
reading the mailing list once a week.

Thank you,

Wojtek Skulski skulski{([at]})nowhere.xy

--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-991511038_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyN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