Click here to Skip to main content
15,891,033 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
JokeRe: Possibly the hottest mess I've seen in some time Pin
den2k882-Apr-23 23:20
professionalden2k882-Apr-23 23:20 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mike Hankey3-Apr-23 0:41
mveMike Hankey3-Apr-23 0:41 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
DrWalter PE26-Apr-23 18:38
professionalDrWalter PE26-Apr-23 18:38 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mike Hankey3-Apr-23 0:31
mveMike Hankey3-Apr-23 0:31 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
honey the codewitch3-Apr-23 7:40
mvahoney the codewitch3-Apr-23 7:40 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mike Hankey3-Apr-23 8:05
mveMike Hankey3-Apr-23 8:05 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mircea Neacsu11-Apr-23 12:15
Mircea Neacsu11-Apr-23 12:15 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mike Hankey11-Apr-23 12:35
mveMike Hankey11-Apr-23 12:35 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
DrWalter PE26-Apr-23 12:46
professionalDrWalter PE26-Apr-23 12:46 
GeneralRe: Possibly the hottest mess I've seen in some time Pin
Mike Hankey26-Apr-23 12:57
mveMike Hankey26-Apr-23 12:57 
GeneralI question Microsoft's documentation Pin
PIEBALDconsult31-Mar-23 5:13
mvePIEBALDconsult31-Mar-23 5:13 
GeneralRe: I question Microsoft's documentation Pin
RainHat3-Apr-23 4:06
RainHat3-Apr-23 4:06 
GeneralRe: I question Microsoft's documentation Pin
PIEBALDconsult3-Apr-23 4:42
mvePIEBALDconsult3-Apr-23 4:42 
GeneralRe: I question Microsoft's documentation Pin
Gary R. Wheeler28-Apr-23 11:45
Gary R. Wheeler28-Apr-23 11:45 
GeneralGDMA on the ESP32S3 Pin
honey the codewitch18-Mar-23 8:29
mvahoney the codewitch18-Mar-23 8:29 
GeneralRe: GDMA on the ESP32S3 Pin
raddevus18-Mar-23 12:45
mvaraddevus18-Mar-23 12:45 
GeneralRe: GDMA on the ESP32S3 Pin
honey the codewitch18-Mar-23 12:52
mvahoney the codewitch18-Mar-23 12:52 
GeneralRe: GDMA on the ESP32S3 Pin
raddevus18-Mar-23 12:59
mvaraddevus18-Mar-23 12:59 
GeneralRe: GDMA on the ESP32S3 Pin
honey the codewitch18-Mar-23 13:31
mvahoney the codewitch18-Mar-23 13:31 
GeneralI must be doing something wrong... Pin
PIEBALDconsult17-Mar-23 13:47
mvePIEBALDconsult17-Mar-23 13:47 
GeneralRe: I must be doing something wrong... Pin
0x01AA17-Mar-23 14:31
mve0x01AA17-Mar-23 14:31 
GeneralRe: I must be doing something wrong... Pin
trønderen17-Mar-23 14:57
trønderen17-Mar-23 14:57 
A study mate of mine went to a job to implement, or rather port, a database system on the VAX. What they had for development and testing was a 730, probably the slowest VAX ever manufactured. They put a large, green "Turtle Wax" sticker on its front panel.

My good friend timed a couple operations: To blank fill an 80 character buffer before reading an input to it took, for blank filling alone, 20 milliseconds. No, not microseconds, but milliseconds. A process switch (I am quite sure they were running VAX VMS; I don't think any alternative was available in 1983) took 100 ms., i.e. 1/10 of a second.

This DBMS was designed as three processes with a lot of interaction between them. Or, rather, as much as was possible given that process switch time. That wasn't a lot! They had to chop one of the processes into pieces and distribute it on the two other processes, so that the interacting parts were (at least to a much higher degree) running in the same process with no process switch necessary. I don't know the details of how they did it, but suspect that they used a home-made coroutine switching, just loading the stack pointer and program counter of the communication partner to have the message processed. (The project leader was a professor of compiler construction, well versed in register and stack management.)

So the answer is sometimes not to increase the number of threads/processes, but exactly the opposite!

If you task is 100% CPU bound, and only 1 CPU is available, then introducing the overhead of thread switching will never speed up things. On the other hand, you rarely see 100% CPU bound tasks, and nowadays, you rarely see a machine with only 1 CPU available. For the VAX 730, it seemed like you had significantly less than 1 CPU available Smile | :)
GeneralRe: I must be doing something wrong... Pin
PIEBALDconsult17-Mar-23 16:05
mvePIEBALDconsult17-Mar-23 16:05 
GeneralRe: I must be doing something wrong... Pin
trønderen17-Mar-23 17:17
trønderen17-Mar-23 17:17 
GeneralRe: I must be doing something wrong... Pin
PIEBALDconsult18-Mar-23 6:15
mvePIEBALDconsult18-Mar-23 6:15 

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.