Click here to Skip to main content
13,247,804 members (60,326 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 19 Apr 2004

Timers & Sockets

, 8 Apr 2005
Rate this:
Please Sign up or sign in to vote.
Control of timers, timings, offered services, and used services.

Sample Image


BOS contains the functionality of the TIM and SOC sub-systems. Seventeen additional routines are provided to satisfy application program requirements in a C/C++ and VB environment. The praxis is that 150TIM+400SOC slots are enough for an application.


Each slot may be set up to signal an event-flag, execute a function, or spin-off a thread; with or without a parameter. A slot is allocated a number (i.e., 1 to 550) on creation. Slots may be removed by slot-number.

Initialization is done when the first call to any relevant routine is made. A slot is set up using make_slot. A slot is destroyed using remove_slot. The BOS sub-system is de-initialized using reset. The user facilitates the actions by calling await_slot.

When a slot is signaled, its actions are performed, unless its action is ‘to return from await_slot’ and we are not in await_slot. When we are, then it will.

A process is expected to set up its slot requirements from any of its threads and then some of these threads spend their time in await_slot. When a thread returns from await_slot, for other than a timeout reason, it will be because a signaled state that has no function or thread entry setup in the relevant slot group has occurred. Having actioned this signaled state, the thread should recall await_slot. Perhaps a common usage will have all slot entries with a function or thread entry point so that the only return from await_slot will be for a timeout reason.

The 'await' and nine 'make' calls take a group number. This allows sub-sets of the collection of slots to be waited on, perhaps by different threads.

Using the code

VC 6.0 projects:

  • Place the BOSDLL.dll in a directory on your path variable.
  • Add the library BOSDLL.lib to the project resources.
  • Add the modules BOScalls.h, SOCcalls.h and TIMcalls.h to the project.
  • Use the routines therein.

VB 6.0 projects:

  • Register the BOSDLL.dll with regsvr32.
  • Add the modules BOSDLL.bas, SOCDLL.bas and TIMDLL.bas to the project.
  • Use the public routines therein.
// Source code to produce the above console screen
// is to be found in the 1st of the 3 demo C/C++ projects.


  • 3.4 - BOS_Src.cpp - Comment/Logging maintenance.
  • 3.3 - For C/C++ only users, a static library can be built using the workspace and the project files provided.
  • 3.2 - Server-side 'select' timeout is reduced from 50 to 1 millisecond. This allows faster transfer, though one's machine will get busier.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United Kingdom United Kingdom
BSc (St.Andrews(1963-67))
Systems Programmer 39+yrs
Married to first wife 35yrs & counting, four grown-up children
Religious opinions similar to MelG's
It is not the gnosis, but the praxis must be the fruit. (Aristotle)

You may also be interested in...

Comments and Discussions

General[Message Deleted] Pin
it.ragester2-Apr-09 22:53
memberit.ragester2-Apr-09 22:53 
[Message Deleted]
GeneralMarried to first wife... Pin
George L. Jackson20-Apr-04 11:34
memberGeorge L. Jackson20-Apr-04 11:34 
GeneralRe: Married to first wife... Pin
Lymington28-Apr-04 13:42
memberLymington28-Apr-04 13:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 8 Apr 2005
Article Copyright 2004 by Lymington
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid