--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00006 Date: 04/01/97 From: CHRIS DOWNS Time: 02:04pm \/To: NIELS JONKER (Read 5 times) Subj: Re: Video DM> Are you SURE that two shift operations followed by an addition is DM> really faster than the hardware-optimized integer multiplication? DM> Perhaps on an 8086... but on an 80486? Probably not... NJ> a shift operation on a pentium takes 1 clockcycle where an integer NJ> multiplication takes 9 for 32bit registers and 11 for 16bit NJ> I roughly calculated the number of clockcycles for both calculations: NJ> x+(y<<6)+(y<<8) => 4 clockcycles NJ> x+y*320 => 11 (32bit), 13 (16bit) NJ> so using shifts is still the fastest way. I suppose it's possible. There are a couple of aspects to running the code that you neglected to include in your analysis. (Like loading the code into the pipeline.) It would be easy enough to benchmark the code and that's the _only_ way you could get a good answer to the question. And perhaps a pentium would be faster with the shifting/adding. All I _know_ is that the above tchnique is slower than .... on a 386. --- Blue Wave/QWK v2.12 * Origin: St. Louis Users Group (1:100/4) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00007 Date: 04/02/97 From: CHRIS DOWNS Time: 10:00am \/To: THOMAS MAEDER (Read 5 times) Subj: Re: Streams CD> Most of the "disadvantages" to iostreams are implentation dependant CD> For example, iostream i/o takes more code space and takes more CD> execution time vs output. But there's no intrinsic reason CD> that _has_ to be! TM> Have you been able to measure this? Here's an example. The first program is... #include int main() { cout << "Hello World" << endl; return 0; } and the second program is... #include int main() { printf ("Hello World\n"); return 0; } For one particular compiler (VC++) the stream version size is 31744 and the stdio version's size is 23552. As for measuring execution speed, I haven't done any tests. For the kind of I/O I typically use, the speed of the code execution isn't what dominates I/O execution time anyway. TM> Sounds very strange to me; I TM> expect streamio to be more efficient both for space and time. Perhaps someday. --- Blue Wave/QWK v2.12 * Origin: St. Louis Users Group (1:100/4) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00008 Date: 04/04/97 From: DARIN MCBRIDE Time: 09:59pm \/To: JERRY COFFIN (Read 5 times) Subj: Multithreading member-functions DM> Perhaps adding RTTI support to ensure we ARE DM> dealing with a ThreadBase pointer here... :-) JC> It can't be done: you can't use RTTI on a pointer to void. RTTI has the JC> same problem you do at that point: it doesn't know enough about the JC> pointer to find out anything. I thought that RTTI _could_ do this for pointers to void. Perhaps not, though... It's been a while since I've had access to semi-decent manuals to RTTI support. Right now, I only have GCC that supports it, and at that very loosely. And the documentation for GCC's C++ support is, well, for all practical purposes, not there. Watcom 10.6 doesn't have anything on it that I can find. :-/ Borland/2 1.5? Let's not even go there. :-) JC> I'm not saving the thread ID, because it's pretty close to useless. JC> I'm not even sure why they have thread IDs at all. DM> I dunno about Win32, but I know that in OS/2 you can raise other DM> thread's priorities, query their state (blocked, DM> running, etc.), block DM> them and, , kill them. (Mind you killing threads has the DM> expected side effect of basically destabilizing DM> the entire process and DM> the entire process should then shut down immediately, preferably with DM> a bit of grace.) All of this requires the thread ID. JC> Under Win32, most, if not all, of this involves the thread handle JC> instead of the ID. Ah. I'm not sure why Win32 added that... I doubt OS/2 1.3 had it (since removing support would break programs, something IBM has committed to not doing). And thus Win32 must support doing this stuff with the original 16-bit OS/2 calls (killing threads was added in OS/2 3, so that's not an item to worry about) using only the thread ID. DM> I'm pretty sure there is a fair bit of other stuff. (For example, in DM> my semaphore objects, I need my thread ID in order to figure out if I DM> am the thread who owns the semaphore or if it is DM> someone else... I can DM> then also figure out who it is so I can kill it ) JC> Umm...I'm a bit lost as to what you're trying to get at here, though it I don't recall if the CriticalSection's in Win32 will actually tell you who owns a semaphore (in case you want to see if it is blocked, say, so that you may have to clear a semaphore to prevent deadlock), but OS/2 does. This way I can ask, "Do I already own the semaphore?" This is useful for, say, private member functions (desperately attempting to stay on topic ) are being called according to the "specification." i.e., function foo::a() can only be called when the calling thread has semaphore foo::sem. I can actually be sure of this via assert! Mind you, I haven't done a lot of threaded applications under OS/2 or Win32, so I don't really have much experience to speak too much on this. :-) JC> does give the glimmer of an idea of a use for the thread ID: it allows JC> you to identify the thread that owns something _without_ giving a thread JC> that receives it any other capabilities such as changing your priority, JC> killing you, etc. Except that you can do all this with the ID under OS/2. :-) --- Maximus/2 3.01 * Origin: Tanktalus' Tower BBS (PVT) (1:342/708) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00009 Date: 04/04/97 From: CAREY BLOODWORTH Time: 09:01pm \/To: DOMINIK SZEWCZYK (Read 5 times) Subj: WOLF3D DS>Hi! I've been playing around with the WOLF3D source code and it does not DS>compile right :( the code compiles but the game is very screwed up...can DS>someone help me?I'll be glad enough to give the source...l8r Join the club! The configuration header (I can't remember the name) does need to be modified. But, some compilers just seem to be unable to compile it. I've tried repeatedly with Turbo C++ 3.0, and it just doesn't seem to work. I don't know if it's the language or a bug, or the code depends on some particular quirk, or what. --- QScan/PCB v1.19b / 01-0162 * Origin: Jackalope Junction 501-785-5381 Ft Smith AR (1:3822/1) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00010 Date: 04/04/97 From: SARAH NUNEZ Time: 08:38am \/To: DANIEL STEFYN (Read 5 times) Subj: Talk On 02 Apr 97, Daniel Stefyn writes to JAMES MAGUIRE: JM>> Hello who is out there? I wish to talk to you! DS> Perhaps it would help if you began a decent thread or joined in on an DS> existing message topic. People rarely respond to these types of DS> messages - spend a bit more time on bbs's and you'll find out why... I suspect he thought this was a chat area and was expecting an instant response. Evidently he didn't know the difference between chat mode and message areas. ... Those who refuse to learn from the past are condemned to repeat it. --- GEcho 1.10/gamma * Origin: WordForce Mail-Only System, Republic of Texas (1:130/604) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00011 Date: 04/05/97 From: TIKA CARR Time: 07:29am \/To: MARCO ALLARD (Read 5 times) Subj: Bitmap in OWL? Marco Allard was saying to All on 03-30-97 16:31: MA> I have to use OWL so it makes it even more difficult, I guess... MA> The Question is: How do I define a bitmap, and how do I use it in my MA> program...(the bitmap is for example arcade.bmp from c:\windows MA> directory) How about: 1. load the bmp into Windows Paint and save it in the clipboard (select it with the edit box and then use Edit/Cut. 2. Use the Resource Workshop to create/edit a bitmap and paste it in there. 3. Link your resource into your program project and use it from there.. (I have no idea how to do that though). When you said "OWL" I assume you have Borland C++ 3.1 or higher, and if so, I know at least 3.1 has a Resource Workshop you can make menus, resources, bitmaps, icons, dlls, drivers, etc. from. Tika Phantom's Gate - Home of the Hacker's Haven http://www.frontiernet.net/~phantom7 * phantom7@frontiernet.net ... Bad command. Bad, bad command! Sit! Stay! Staaay... ___ Blue Wave/DOS v2.30 --- QScan/PCB v1.17b / 01-0406 * Origin: Knight Moves - Rochester,NY 716-865-2106 (1:2613/313) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00012 Date: 04/05/97 From: THOMAS MAEDER Time: 11:15am \/To: MARCO ALLARD (Read 5 times) Subj: Bitmap in OWL? MA> The Question is: How do I define a bitmap, and how do I use it in m MA> program... MA> (the bitmap is for example arcade.bmp from c:\windows directory) From the OWL help: To link the standalone bitmap file to a resource project file [...] 1. Open a resource project file, or click in a .RC project window. 2. Choose Add to Project. 3. Select the .BMP file you created. Thomas --- MM 1.0 #0113 Equal bytes for women. * Origin: McMeier & Son BBS (2:301/138) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00013 Date: 04/05/97 From: THOMAS MAEDER Time: 11:18am \/To: WIM VELDHUIS (Read 5 times) Subj: STATIC? SAY WHAT? WV> NH> TM> The keyword "static" is used for two purposes in C++. WV> 3. to change the life time of a local variable in a function. I referred to using static for functions/methods (which is the subject of this thread). But I admit I wasn't very exact in my messages. Thomas --- MM 1.0 #0113 I used up all my sick days, so I'm calling in dead. * Origin: McMeier & Son BBS (2:301/138) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00014 Date: 04/01/97 From: JEAN-POL LANDRAIN Time: 03:22pm \/To: JERRY COFFIN (Read 5 times) Subj: C++ Formatted Output Salut Jerry, Jerry Coffin crivait le Lundi 17 Mars 1997 Jean-Pol Landrain : JC> On (16 Mar 97) Jean-Pol Landrain wrote to Jerry Coffin... JC> [ wanting to write a manipulator with two parameters ] JC> Just FWIW, recent versions of BC++ use templates instead of macros. JC> However, since you say you're using macros, I'll do a macro based JC> one ... JC> Later, JC> Jerry. Great !!! That's exactly what I was looking for. Now, how can I do that with templates ? Amitis, Jean-Pol --- GoldED/386 2.50+ * Origin: Mininet 97 +32(0)87/88-33-44 - Cimes (2:293/4004.104) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E4A00015 Date: 04/03/97 From: JEAN-POL LANDRAIN Time: 08:31am \/To: ERIC RULLENS (Read 5 times) Subj: Borland c++ builder Salut Eric, Eric Rullens crivait le Lundi 31 Mars 1997 All : ER> I'm curious about Borland's C++ Builder too... ER> There must be someone out there who knows more about it? ER> Well... c ya for now Yes, but there isn't a lot to say about it. It's great ... It's still C++ (VCL instead of OWL) ... Try it ! Amitis, Jean-Pol --- GoldED/386 2.50+ * Origin: Mininet 97 +32(0)87/88-33-44 - Cimes (2:293/4004.104)